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(
|
public canActivate(
|
||||||
context: ExecutionContext
|
context: ExecutionContext
|
||||||
): boolean | Promise<boolean> | Observable<boolean> {
|
): boolean | Promise<boolean> | Observable<boolean> {
|
||||||
|
// Check if the current route is marked as public
|
||||||
const isPublic = this.reflector.getAllAndOverride<boolean>('isPublic', [
|
const isPublic = this.reflector.getAllAndOverride<boolean>('isPublic', [
|
||||||
context.getHandler(),
|
context.getHandler(),
|
||||||
context.getClass(),
|
context.getClass(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Allow access if the route is public, otherwise defer to the standard JWT authentication mechanism
|
||||||
if (isPublic) {
|
if (isPublic) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue