Customizing AshAuthentication.Phoenix
According to https://hexdocs.pm/ash_authentication_phoenix/AshAuthentication.Phoenix.html there are several ways to customise the authentication process:
1. Use the generic sign-in liveview - AshAuthentication.Phoenix.SignInLive.Apply
2. overrides using AshAuthentication.Phoenix.Overrides to set your own CSS classes for all components.
3. Build your own sign-in pages using the pre-defined components.
4. Build your own sign-in pages using the generated auth routes.
Are there any examples, especially for 3 and 4?
Do I even need AshAuthentication.Phoenix in these cases?
Furthermore, out of curiosity, am I able to use the standard
phx.gen.auth
from phoenix and point to an ash resource instead of an ecto schema?5 Replies
There aren't any examples provided by us for 3/4 (I'm not sure 4 is possible)
That may be something that should be removed. Will have to ask @jart
You can use
phx.gen.auth
, yes. But you will need to rewrite a fair amount of code from its ecto equivalent to its Ash equivalent.Thanks for the quick reply.
So, how would I build an own sign in page then? Could I solely require AshAuthentication then and do not need anything from AshAuthentication.Phoenix?
You will likely still want
AshAuthenticationPhoenix
to handle the actual sign in/authentication of users honestly
Your best bet for implementing your own page currently is to look at the liveviews defined by ash_authentication_phoenix and copy them into your own thingAlright, I will check the code to get a better understanding here.
Just saw
Which seems that I can provide my own live_view component
Ah, okay that makes sense
So I guess you can use your own liveview that way 🙂