added comments
This commit is contained in:
parent
250c48e8c6
commit
0d94527aec
|
@ -12,11 +12,13 @@ export class AccessTokenGuard extends AuthGuard('jwt-access-token') {
|
|||
public canActivate(
|
||||
context: ExecutionContext
|
||||
): boolean | Promise<boolean> | Observable<boolean> {
|
||||
// Check if the current route is marked as public
|
||||
const isPublic = this.reflector.getAllAndOverride<boolean>('isPublic', [
|
||||
context.getHandler(),
|
||||
context.getClass(),
|
||||
]);
|
||||
|
||||
// Allow access if the route is public, otherwise defer to the standard JWT authentication mechanism
|
||||
if (isPublic) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue