Ash FrameworkAF
Ash Framework3y ago
6 replies
Wout

How to login with a generated Magic Link in Phoenix (ash_authentication ash_phoenix_authentication)

I'm trying to implement the new Magic Link strategy in ash_authentication. I can succesfully send an email with a magic link token, but how do I use that token to then login the user? For example with password reset, the token goes in the url, and that works, I'd imagine you have to do something similar with a magic link, but that route doesn't seem to be available.

This is what mix phx.routes returns, where there's no room to put a token.
          auth_path  *     /auth/user/magic_link/request          ExampleWeb.AuthController {:user, :magic_link, :request}
          auth_path  *     /auth/user/magic_link                  ExampleWeb.AuthController {:user, :magic_link, :sign_in}


So my question is what URL should the email return, and how do I login with that URL. I imagine I have to make a controller for it but I couldn't find anything in the docs for it.
Was this page helpful?