Relative Content

Tag Archive for node.jsauthenticationjwtauthorizationmern

Fix User Authentication in Node.js

I am making a login system in mern stack, i am using jwt token based login system in the backend. In the provided code i am querying database for every page user requests to check wheather user is present in database. I don’t want to run database query for every request how can i make this better and save user information in token and authenticate user with token. Will this be a good idea?, i am a beginner.