Ash FrameworkAF
Ash Frameworkβ€’3y agoβ€’
40 replies
Robert Graff

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?

AshPhoenix.Form.submit(socket.assigns.password_form, params: params, actor: socket.assigns.current_user) 
...

validate {AshAuthentication.Strategy.Password.PasswordValidation, password_argument: :current_password} do
  only_when_valid?(true)
  before_action?(true)
  message("Password incorrect")
end
Was this page helpful?