DEV Community

Discussion on: What are the good practices to Node.js web app authentication and authorization?

Collapse
 
ridaehamdani profile image
Ridae HAMDANI

I think the best solution is to store the token in the localStorage of the browser if you want to keep the user logged in ,otherwise use session storage.
Then send the token with every API request and check the validation of the token in every endpoint that needs authentication or authorisation ( create a middleware for that and add it to routes ).
You can check that repository I create a time ago

GitHub logo ridaeh / Handmade

Dynamic website

.
Collapse
 
artis3n profile image
Ari Kalfus