mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-21 05:43:05 +12:00
chore: add false
filter on nil identity_field (#767)
This commit is contained in:
parent
ccd0eb00d9
commit
151240df32
1 changed files with 8 additions and 1 deletions
|
@ -25,8 +25,15 @@ defmodule AshAuthentication.Strategy.Password.SignInPreparation do
|
|||
identity_field = strategy.identity_field
|
||||
identity = Query.get_argument(query, identity_field)
|
||||
|
||||
query =
|
||||
if is_nil(identity) do
|
||||
# This will fail due to the argument being `nil`, so this is just a formality
|
||||
Query.filter(query, false)
|
||||
else
|
||||
Query.filter(query, ^ref(identity_field) == ^identity)
|
||||
end
|
||||
|
||||
query
|
||||
|> Query.filter(^ref(identity_field) == ^identity)
|
||||
|> check_sign_in_token_configuration(strategy)
|
||||
|> Query.before_action(fn query ->
|
||||
Ash.Query.ensure_selected(query, [strategy.hashed_password_field])
|
||||
|
|
Loading…
Reference in a new issue