-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Both guards are redefining the jwt functions on every call. In consequence, every API call leads to a new call to Auth0 - very bad for performance.
Looking at https://github.com/auth0-developer-hub/api_nestjs_typescript_hello-world/blob/main/src/authorization/authorization.guard.ts#L22, I think it should be:
...
export class AuthorizationGuard implements CanActivate {
private validateAccessToken = promisify(auth());
async canActivate(context: ExecutionContext): Promise<boolean> {
const request = context.switchToHttp().getRequest<Request>();
const response = context.switchToHttp().getResponse<Response>();
try {
await this.validateAccessToken(request, response);
...Please do not use this repository as is.
SouhailRAZZOUKSouhailRAZZOUK
Metadata
Metadata
Assignees
Labels
No labels