bulletproof-nodejs
bulletproof-nodejs copied to clipboard
Jwt invalid algorithm
I have got token from user signIn & signUp function. But when i set token in headers authorization, It returns
{
"message": "invalid algorithm"
}
i am so curious to know what this is happening. Also I double check config values are already loaded.
Thank you.
const isAuth = jwt({
secret: config.jwtSecret, // The _secret_ to sign the JWTs
algorithms: ['HS256'], // JWT Algorithm
userProperty: 'token', // Use req.token to store the JWT
getToken: getTokenFromHeader, // How to extract the JWT from the request
});
Change algorithms value to the example I posted above
It is working with HS256 Algorithm