Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetVerificationKey type doesn't match auth0/node-jwks-rsa #304

Closed
kylerm42 opened this issue Oct 13, 2022 · 0 comments · Fixed by #305
Closed

GetVerificationKey type doesn't match auth0/node-jwks-rsa #304

kylerm42 opened this issue Oct 13, 2022 · 0 comments · Fixed by #305

Comments

@kylerm42
Copy link
Contributor

Description

A PR was recently merged to auth0/node-jwks-rsa that changed the type of GetVerificationKey, which breaks the interaction with express-jwt.

Reproduction

import * as jwks from "jwks-rsa";
import { expressjwt } from "express-jwt";
const secret = jwks.expressJwtSecret({...}) as jwks.GetVerificationKey;
expressjwt({ secret });

This code gives the TypeScript error:

Type 'GetVerificationKey' is not assignable to type 'Secret | GetVerificationKey'.
  Type 'import("/node_modules/jwks-rsa/index").GetVerificationKey' is not assignable to type 'import("/node_modules/express-jwt/dist/index").GetVerificationKey'.
    Type 'Secret | Promise<Secret | undefined> | undefined' is not assignable to type 'Secret | Promise<Secret>'.
      Type 'undefined' is not assignable to type 'Secret | Promise<Secret>'

Environment

  • Version of this library used: 7.7.5
  • Version of node-jwks-rsa library used: 2.1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant