Raz Buchnik
Raz Buchnik

Reputation: 8401

Why using JWT rather than store token in DB for authorize an access token in Node.js?

I am not really sure about JWT mechanism and why its better (if its) than just store and match user's token from his DB document to grant and access?

Upvotes: 1

Views: 135

Answers (1)

Gabriel Bleu
Gabriel Bleu

Reputation: 10204

Main benefit from JWT is speed, you can verify the token to check if the user can access the resource and retrieve basic user information without doing any database query.

Upvotes: 1

Related Questions