adonisjs / auth

Official Authentication package for AdonisJS
https://docs.adonisjs.com/guides/auth/introduction
MIT License
194 stars 65 forks source link

OAT Verify current time against expiresAt field for authentication #185

Closed 416c616e closed 2 years ago

416c616e commented 2 years ago

https://github.com/adonisjs/auth/blob/08c0e33b4250ee6e61625eb09a64b11e347eec91/src/Guards/Oat/index.ts#L360

Would be handy to also check the expiresAt field against the current time to ensure the token hasn't expired.

Resolved it myself, I'm a big dumb dumb. On another note with it working correctly it would perhaps be nice to have the ability to assign a callback to optionally prune the token storage/db

thetutlage commented 2 years ago

Its already validated. https://github.com/adonisjs/auth/blob/08c0e33b4250ee6e61625eb09a64b11e347eec91/src/TokenProviders/Database/index.ts#L107-L113