Learn how to implement and customise Ash Authentication in Elixir applications using simple DSL on Ash resources with Phoenix LiveView integration.
Solution
I just figured it out
If someone could explain why the following worked, that would be awesome!
The issue was that originally I couldn't sign in nor register.
# index.ex# In my actions I replaced this# |> assign(:form, to_form(MyApp.Accounts.form_to_register_with_password()))# with this|> assign( :form, AshPhoenix.Form.for_create(MyApp.Accounts.User, :register_with_password, api: MyApp.Accounts, as: "user"))# form.ex<.form # I added this in the form :let={f} # ... # in my inputs <.input field={f[:email]} # ...# In the eventsdef handle_event("validate", %{"user" => params}, socket) do
# index.ex# In my actions I replaced this# |> assign(:form, to_form(MyApp.Accounts.form_to_register_with_password()))# with this|> assign( :form, AshPhoenix.Form.for_create(MyApp.Accounts.User, :register_with_password, api: MyApp.Accounts, as: "user"))# form.ex<.form # I added this in the form :let={f} # ... # in my inputs <.input field={f[:email]} # ...# In the eventsdef handle_event("validate", %{"user" => params}, socket) do
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.