adonisjs / auth

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

Delete revoked token instead of updating a column #67

Closed RomainLanz closed 6 years ago

RomainLanz commented 6 years ago

Closes https://github.com/adonisjs/adonis-auth/issues/66

thetutlage commented 6 years ago

I believe we should not change all this at the serializer level, since tokens can be used for other stuff too, apart from remember_me_token.

For example: It is fine to manually revoke an apiToken and thus all of the queries will start failing, since in this PR we removed is_revoked clause from the query

RomainLanz commented 6 years ago

If we want to keep the behaviour of revoking a token (without deleting it) I can create a deleteToken method inside Serializers and call it here https://github.com/adonisjs/adonis-auth/blob/develop/src/Schemes/Session.js#L223

RomainLanz commented 6 years ago

Updated 👍