mirror of
https://github.com/team-alembic/ash_authentication_phoenix.git
synced 2024-09-19 21:13:52 +12:00
fix: show password strategy message if field
is nil
at some point this must have changed where `field` is not being set, and so `Invalid email or password` stoppped showing as the form error
This commit is contained in:
parent
dbecf5b94c
commit
ee7347d9f0
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ defimpl AshPhoenix.FormData.Error, for: AshAuthentication.Errors.AuthenticationF
|
||||||
|
|
||||||
def to_form_error(_), do: []
|
def to_form_error(_), do: []
|
||||||
|
|
||||||
defp to_auth_failed_error(error) when error.strategy.password_field == error.field do
|
defp to_auth_failed_error(error) when error.strategy.password_field == error.field or is_nil(error.field) do
|
||||||
[
|
[
|
||||||
{error.strategy.password_field,
|
{error.strategy.password_field,
|
||||||
"#{humanize(error.strategy.identity_field)} or #{downcase_humanize(error.strategy.password_field)} was incorrect",
|
"#{humanize(error.strategy.identity_field)} or #{downcase_humanize(error.strategy.password_field)} was incorrect",
|
||||||
|
|
Loading…
Reference in a new issue