Need someone to review my JWT authentication code

I am learning JWT authentication .As I don’t have mentor to review my code which I learnt so I need stackoverflow commmunity to review my code . I used following language expressjs ,mongodb,jwt and handlebars because I dont know react or any library

My code do is :
1) register user
2) then logging in
3) if the user is authenticated using JWT token then the protected page which is '/user' endpoint 
will be accessible
4) at last a logout facility
5) I have added refresh token facility too with expiry of main token of 30 seconds

here is my code which is on github enter link description here

I really need your help

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.