Can't test authentication after configuring Ash AuthenticationPhoenix Tutorial
After following steps on the tutorial for configuring authentication with phoenix, im getting errors on the routes as if the AuthController was not working. When Accessing the main route http://localhost:4000 i get this error:
And if I get on the 'sign-in' page i can only see the header for the page.
I'm new with elixir and phoenix so this might be a problem with me not ocnfiguring something correctly but i've triple checked most things and cant get it working.


28 Replies
Do you have the api that contains your user in
config :your_app, :ash_apis
?
And have you added your user/token resource to the registry for that app?
i.e config :your_app, :ash_apis, [YourApp.Accounts]
thank you @Zach Daniel this helped a bit, i added
I only had the first api registered
i can see the home page correctly

Can you link me to the guide you're following?
but the sign in route shows me this
yes
Ash HQ
Guide: Getting Started With Ash Authentication Phoenix
Read the "Getting Started With Ash Authentication Phoenix" guide on Ash HQ
Ash HQ
Guide: Getting Started With Ash Authentication Phoenix
Read the "Getting Started With Ash Authentication Phoenix" guide on Ash HQ
Did you do that step?
oh i think i missed that

now i think its working
Nice! I think you need the tailwind config set up as well
Ash HQ
Guide: Getting Started With Ash Authentication Phoenix
Read the "Getting Started With Ash Authentication Phoenix" guide on Ash HQ
i might have something else missing here, sign in and sign out works correctly, but when there is an error on authentication (wrong password) i get this:


i also finished implementing the reset password interactions, but i get this when accessing the reset url

Can you check for updates to
ash_authentication
and ash_authentication_phoenix
?
Did you do the part about creating the failure.html
file? with <h1 class="text-2xl">Authentication Error</h1>
in itsure, i have these versions on the libs side:
ash 2.6.27
ash_authentication 3.10.2
ash_authentication_phoenix 1.6.5
ash_phoenix 1.2.11
ash_postgres 1.3.18
i also created the failure.html.heex template
thank you for reading this



Are you still getting the
:socket
is a reserved assign error?yes, no changes

🤔 Can you try using ash_authentication_phoenix main?
{:ash_authentication_phoenix, github: "team-alembic/ash_authentication_phoenix"}
sure, let me try this,
it worked
the reset password url now showed the correct form
Hmm...something must be wrong with the automated releases or something then.
we'll address that soon
for now I'd suggest just staying on the main branch
ohh ok
the failure html is not working tough
not working in what way?
if i enter a wrong password on the sign in page, i get this page

🤔 not sure whats going on there, but it must be something wrong with the phoenix set up
although, FWIW, you probably don't want that failure.html page anyway
Typically what people will do is just redirect back to sign in with a flash message
i understand, i will try to adjust to that behavior
maybe tomorrow ill start over just to see if it was something on the config step i missed
thank you Zach
have a great day