Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revoking Token thats already been removed throws error rather than returning error #102

Closed
rraub opened this issue Apr 11, 2019 · 1 comment

Comments

@rraub
Copy link
Contributor

rraub commented Apr 11, 2019

We've run into a condition where a request to refresh a token was replayed which resulted in duplicate requests processed at the same time. The first one succeeded and the second one failed with an Ecto.StaleEntryError when trying to revoke and delete the token. Instead of doing a delete on the Model could we just do a delete by the value of the primary key so we can return an {:error} instead of throwing an error?
Similar to:

|> Guardian.DB.repo().delete_all(prefix: prefix())

@yordis
Copy link
Member

yordis commented Apr 11, 2019

@rraub would you mind to open a PR with the desired behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants