auth0 / express-jwt

connect/express middleware that validates a JsonWebToken (JWT) and set the req.user with the attributes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type 'SecretCallbackLong' is not assignable to type 'GetVerificationKey'.

ValchanOficial opened this issue · comments

express-jwt version: 7.6.0
jwks-rsa version: 2.1.1

Before express-jwt update, this code was working
Old version: 6.1.1

image

Could you help me? Thank you in advance!!

ouch! we have tried so many times to fix this issue 😖

The newest version of jwks-rsa is compatible with the express-jwt but there is an issue with the typings.

Can you use as GetVerificationKey for the time being as follows:

import { expressjwt, GetVerificationKey } from 'express-jwt';
import { expressJwtSecret } from 'jwks-rsa';


expressjwt({
  secret: expressJwtSecret({
    jwksUri: 'https://foobar.com'
  }) as GetVerificationKey,
  algorithms: ['RS512']
});