Set error message on attribute using AshAuthentication.Strategy.Password.PasswordValidation
When a password validation fails on a liveview form submitted. How do I get an error on the
:current_password
attribute?
21 Replies
Do you currently not get that?
what error do you get currently?
if I call
User.update_password(user, %{...})
with an incorrect password then I'll get the invalid error as expected but it's not associated with any fields.
And I don't see the error on form after a submitHere's the form returned submit: https://gist.github.com/rgraff/6677b4d2018c2325d2dc07557d1c2e68
ah
that looks like a bug in AshAuthentication
we should set the field on that error
Would you be interested in PR-ing the fix? Should be able to track it down in the
AshAuthentication
codebase and add the fields: [password_field]
to the exceptionI'm definitely interested in that but I'm also very new to Ash, Phoenix and even Elixir. I'll make an attempt though.
Just LMK if you have any questions, happy to provide some pointers π
Am I going in the right direction? https://github.com/team-alembic/ash_authentication/pull/276/files
I think so, yeah π have you tried it out?
I ran into some spark errors. I think because of different package version. I will test today
@Zach Daniel confirmed it works in my app
π₯³
in that case π
I'm going to attempt a unit test
I'm not able to run tests locally. Is there a way to trigger CICD on PRs?
It should trigger automatically
huh...strange that its not
okay, I just added the missing config for that
You may need to pull main and/or re-open your PR to make it work
alright, had to approve it since its your first PR against that repo
but its running now π
Fixing CI issue, can you trigger approve workflow? https://github.com/team-alembic/ash_authentication/pull/279
I re-opened a PR with a proper commit message
yep, sorry about that
π€ it might be yelling about the length? Either way, you can use
git commit --amend
and git push --force
to not have to reopen your PR
Try something like this:
Pushed fix
oops, it was still erroring but I merged it
Oh well, thanks for the fix π
My first open source contribution in Elixir π
congrats!
Are you on twitter? Sounds like a fun thing to shout you out for π
only if you'd like, of course π
Yep. I'm @the_rogue_bear_graff
Nice! Just tweeted it. You are also the 100th contributor!
π₯³