i in the following code
@impl true
def handle_event("validate", %{"user" => user_params}, socket) do
email = user_params["email"]
password = user_params["password"]
case confirm_user(user_params) do
{:ok, user} ->
IO.inspect("el usuario esta habilitado a entrar")
changeset =
socket.assigns.user
|>Accounts.change_user(user_params)
{:noreply, assign_form(socket, changeset)}
{:error, user} ->
IO.inspect("usuario no habilitado")
changeset =
socket.assigns.user
|>Accounts.change_user(user_params)
|> Map.put(:action, :validate)
{:noreply, assign_form(socket, changeset)}
end
end
I am managing to validate if the user is valid or not
but i need to display a message in my frontend saying the user is invalid in the form
currently managed to display a message that says can’t be blank but i need put a message that says invalid email or password