import { Public } from "@edr/api-common"; import { Controller, Get, Header } from "@nestjs/common"; import { ApiOperation, ApiTags } from "@nestjs/swagger"; import { SupportContentService } from "./support-content.service"; /** * The portal's /help, /faq, /terms and /privacy routes are deliberately outside * its auth guard — the sign-up screen links to them before a session exists — * so this read must work with no token. `@Public()` is class-level because that * is the idiom the other genuinely-anonymous controllers here use; without it * the globally registered `JwtGuard` would 401 every anonymous visitor. */ @ApiTags("support-content") @Public() @Controller("support-content") export class PublicSupportContentController { constructor(private readonly service: SupportContentService) {} @Get() // Hit on every anonymous page view, and the copy changes a few times a year. @Header("Cache-Control", "public, max-age=300") @ApiOperation({ summary: "Public help, FAQ, legal and support-contact copy for the portal", }) getBundle() { return this.service.getBundle(); } }