auth0/express-jwt

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

ValchanOficial opened this issue · 4 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']
});

Would be great if the typings were consistent with each other, but good to know that they are supposed to work together. Then it feels safer to cast.

@Sti2nd thanks for the feedback, I think this should fix it auth0/node-jwks-rsa#412