-
Notifications
You must be signed in to change notification settings - Fork 233
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
express-jwt integration issues with new v7 #296
Comments
Yes I have same problem and the function sig from the returned function from expressJwtSecret is broken. I was told to use this instead; const expressJwtSecret = function (options) {
However, this also does not work (mine times out when trying to find scopes). So the "integration" between the two modules is broken. Go back to 6.1.2 until both are fixed. |
const expressJwtSecret = function (options) {
if (options === null || options === undefined) {
throw new ArgumentError('An options object must be provided when initializing expressJwtSecret');
}
const client = new jwksRsa.JwksClient(options);
const onError = options.handleSigningKeyError || handleSigningKeyError;
return function secretProvider (req, token) {
const { header } = token;
if (!header || !supportedAlg.includes(header.alg)) {
return;
}
return client.getSigningKey(header.kid)
.then(key => {
return key.publicKey || key.rsaPublicKey;
}).catch(err => {
return new Promise((resolve, reject) => {
onError(err, (newError) => reject(newError));
});
});
}
} |
fixed in v2.1 |
I have a project mostly following the express example, and having issues after upgrading to express-jwt 7.4.3.
Haven't looked too deeply yet, could be just the example needs updating.
Thanks!
The text was updated successfully, but these errors were encountered: