this is my authGard implementation
import {
CanActivate,
ExecutionContext,
Injectable,
UnauthorizedException,
} from ‘@nestjs/common’;
import { expressjwt } from ‘express-jwt’;
import { expressJwtSecret } from ‘jwks-rsa’;
import { promisify } from ‘util’;
@Injectable()
export class AuthorizationGuard implements CanActivate {
canActivate(context: ExecutionContext): boolean | Promise {
const req = context.switchToHttp().getRequest();
return this.validateRequest(req);
}
validateRequest(req: Request): boolean | Promise {
const checkJwt = expressjwt({
secret: expressJwtSecret({
cache: true,
rateLimit: true,
jwksRequestsPerMinute: 5,
jwksUri: ``,
}),
audience: ‘’,
issuer: ‘’,
algorithms: [‘RS256’],
});
return new Promise((resolve, reject) => {
checkJwt(req, {}, (err) => {
if (err) {
throw new UnauthorizedException();
}
resolve(true);
});
});
}
}
I am getting this error
Type ‘SecretCallbackLong | GetVerificationKey’ is not assignable to type ‘Secret | GetVerificationKey’.
Type ‘SecretCallbackLong’ is not assignable to type ‘Secret | GetVerificationKey’.
Type ‘SecretCallbackLong’ is not assignable to type ‘GetVerificationKey’.
Target signature provides too few arguments. Expected 4 or more, but got 2.ts(2322)