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:
Zach Daniel 2024-04-13 17:55:39 -04:00
parent dbecf5b94c
commit ee7347d9f0

View file

@ -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",