mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-19 21:03:23 +12:00
fix: ensure tenant is set when revoking tokens and on changeset for updating
This commit is contained in:
parent
43642c305e
commit
e1cdc10b89
1 changed files with 3 additions and 3 deletions
|
@ -235,13 +235,13 @@ defmodule AshAuthentication.Strategy.Password.Actions do
|
|||
ash_authentication?: true
|
||||
}
|
||||
})
|
||||
|> Changeset.for_update(resettable.password_reset_action_name, params)
|
||||
|> Changeset.for_update(resettable.password_reset_action_name, params, options)
|
||||
|> Changeset.after_action(fn _changeset, record ->
|
||||
token_resource = Info.authentication_tokens_token_resource!(resource)
|
||||
:ok = TokenResource.revoke(token_resource, token)
|
||||
:ok = TokenResource.revoke(token_resource, token, options)
|
||||
{:ok, record}
|
||||
end)
|
||||
|> Ash.update(options)
|
||||
|> Ash.update()
|
||||
else
|
||||
{:error, %Changeset{} = changeset} -> {:error, changeset}
|
||||
_ -> {:error, Errors.InvalidToken.exception(type: :reset)}
|
||||
|
|
Loading…
Reference in a new issue