Skip to content

Commit

Permalink
fix: pass tenant through token revoked check
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Feb 17, 2025
1 parent 2920ac4 commit 19f3675
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ash_authentication/token_resource/is_revoked.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ defmodule AshAuthentication.TokenResource.IsRevoked do
alias AshAuthentication.{Errors.InvalidToken, Jwt}

@impl true
def run(%{resource: resource, arguments: %{jti: jti}}, _, _) when is_binary(jti) do
def run(%{resource: resource, arguments: %{jti: jti}}, _, context) when is_binary(jti) do
resource
|> Ash.Query.do_filter(purpose: "revocation", jti: jti)
|> Ash.Query.set_context(%{
private: %{ash_authentication?: true}
})
|> Ash.Query.set_tenant(context.tenant)
|> Ash.exists()
end

Expand Down

0 comments on commit 19f3675

Please sign in to comment.