Fix guardian db hook when refresh the access token
This commit is contained in:
@@ -61,6 +61,14 @@ defmodule MobilizonWeb.Guardian do
|
||||
end
|
||||
end
|
||||
|
||||
def on_refresh({old_token, old_claims}, {new_token, new_claims}, _options) do
|
||||
with {:ok, _, _} <- Guardian.DB.on_refresh({old_token, old_claims}, {new_token, new_claims}) do
|
||||
{:ok, {old_token, old_claims}, {new_token, new_claims}}
|
||||
end
|
||||
end
|
||||
|
||||
def on_exchange(old_stuff, new_stuff, options), do: on_refresh(old_stuff, new_stuff, options)
|
||||
|
||||
# def build_claims(claims, _resource, opts) do
|
||||
# claims = claims
|
||||
# |> encode_permissions_into_claims!(Keyword.get(opts, :permissions))
|
||||
|
||||
Reference in New Issue
Block a user