Closed kelostrada closed 6 years ago
From what I understand, revoke only works if you are storing the tokens somewhere, such as with GuardianDB
I think I'm having similar issues.
From the README:
# remove from session (if fetched) and revoke the token
conn = MyApp.Guardian.Plug.sign_out(conn)
However, revoke is indeed never called. So, that seems to be an error in the documentation.
I am trying to hook up GuardianDB and follow the instructions there. It instructs to just put the GuardianDB interface on the on_revoke
-hook like this:
def on_revoke(claims, token, _options) do
with {:ok, _} <- Guardian.DB.on_revoke(claims, token) do
{:ok, claims}
end
end
In my app I just call the MyApp.Guardian.Plug.sign_out(conn)
and the on_revoke
is never triggered, therefore never deleting a persisted token in the database...
@doomspork would a PR fixing this be appreciated? Or is this wanted behaviour?
@tarzan please do open a PR 👍
Should be solved by #458.
Hey guys, didn't want to open a new issue for this, but even after reading PR by @tarzan and installing guardian 1.01, the revoke callback is never called for me. I'm wondering what am I missing. Can you guys confirm it's actually being called? thanks
Edit: I think I got confused, looks like that stuff was not released yet.. When can we expect a release?
@mirago we wanted to package up some other changes but we can cut a release with these changes 👍
In the meantime you can do: {:guardian, github: "ueberauth/guardian"}
thanks for your reply, I will wait for the release, until then I am calling revoke manually and all works perfectly. 👍
Is it intentional that
sign_out
doesn't call revoke on tokens?