Files
twenty/packages/twenty-server/src/engine/guards/public-endpoint.guard.ts
T
Félix Malfait 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

21 lines
573 B
TypeScript

import {
type CanActivate,
type ExecutionContext,
Injectable,
} from '@nestjs/common';
/**
* Guard that explicitly marks an endpoint as public/unprotected.
* This guard always returns true and serves as documentation
* that the endpoint is intentionally accessible without authentication.
*
* Usage: @UseGuards(PublicEndpointGuard)
*/
@Injectable()
export class PublicEndpointGuard implements CanActivate {
canActivate(_context: ExecutionContext): boolean {
// Always allow access - this is an explicit marker for public endpoints
return true;
}
}