JWT Authentication Implementation
JSON Web Token (JWT) is a compact, self-contained token that carries claims (user ID, roles, expiry) signed with a secret key. The server validates the signature on every request without touching the database — making it ideal for stateless REST APIs. A typical flow: login → receive access token + refresh token → send Bearer token on every request.