We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ensureAuthorized
node-authenticator/src/middleware/ensureAuthorized/index.js
Line 161 in 4d2a3f4
This code is broken. sign returns a promise but it's being assigned to token. Needs to be refactored like this :
sign
token
const maybeOfferNewTokenHeader = () => Promise.resolve() .then(() => MASTER_PRIVATE_KEY ? sign( decoded, MASTER_PRIVATE_KEY.replace(/\\n/g, '\n'), { algorithm : 'RS256', expiresIn : process.env.JWT_TTL || '20s' }) : req.get('x-auth-token') ) .then(token => { res.set('x-auth-token', token); }); return Promise.resolve(secret) .then(verifyRSJWT(verify)(token)) .then(maybeOfferNewTokenHeader) .then(setReqUser) .then(() => continueWithErrorIfNotPermitted(axios, checkPermission)(decoded, req, next));
The text was updated successfully, but these errors were encountered:
SeanCannon
No branches or pull requests
node-authenticator/src/middleware/ensureAuthorized/index.js
Line 161 in 4d2a3f4
This code is broken.
sign
returns a promise but it's being assigned totoken
. Needs to be refactored like this :The text was updated successfully, but these errors were encountered: