1

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?

Raz Buchnik
  • 7,753
  • 14
  • 53
  • 96
  • 2
    Possible duplicate of [JSON Web Token (JWT) benefits over a database session token](https://stackoverflow.com/questions/26216489/json-web-token-jwt-benefits-over-a-database-session-token) – zero298 Jul 10 '18 at 14:56

1 Answers1

1

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.

Gabriel Bleu
  • 9,703
  • 2
  • 30
  • 43
  • You are just right. Maybe I was not explained this good enough. Why should I use JWT plugin in order to sign instead of using the cyrpto node.js core module and just sign it by myself, why I need more middle dependency? I would love to use how few dependencies as I can – Raz Buchnik Jul 11 '18 at 05:26
  • 1
    Because it's easier to use and it is maintained by a community. – Gabriel Bleu Jul 11 '18 at 06:39