mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Added a note on secret transformation before token verification
refs #9865 - Added some clarificatoin around why secret used for token verification has to be transformed binary decoded from hex
This commit is contained in:
parent
11c910ec8c
commit
3274138ff3
@ -84,6 +84,10 @@ const authenticate = (req, res, next) => {
|
||||
}));
|
||||
}
|
||||
|
||||
// Decoding from hex and transforming into bytes is here to
|
||||
// keep comparison of the bytes that are stored in the secret.
|
||||
// Useful context:
|
||||
// https://github.com/auth0/node-jsonwebtoken/issues/208#issuecomment-231861138
|
||||
const secret = Buffer.from(apiKey.get('secret'), 'hex');
|
||||
|
||||
// ensure the token was meant for this endpoint
|
||||
|
Loading…
Reference in New Issue
Block a user