Skip to content

Error: algorithms should be set – JWT Error – How to fix?

To fix the error – Error: algorithms should be set – just add the algorithms to the JWT constructor.

const authenticate = jwt({
	secret: secret,
	algorithms: ['RS256'] //this should be added
});
See also  How to add an element to an array in JavaScript?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.