elysiajs / elysia-jwt

Plugin for Elysia for using JWT Authentication
MIT License
38 stars 16 forks source link

Feat: expired token should still return content #17

Open MariuzM opened 10 months ago

MariuzM commented 10 months ago

When i do jwt.verify and token is expired i only get false returned, but when is not expired i get the token payload.

Would be really nice if its expired to still return the payload. Maybe:

{
  "payload": {},
  "status": false
}
dickeyy commented 6 months ago

why though? just check if status == true before doing anything with the payload. there's no point in wasting space for an empty payload object that does nothing. or just do if (payload) .... I don't see the purpose in sending a payload for an expired/invalid token.