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

Read more of this post