Darth-Knoppix
Using magic links for registration
I’m having trouble figuring out if Ash Authentication Phoenix supports registration via magic link by default.
Context
- I’ve setup password authentication, resets and magic links following through https://hexdocs.pm/ash_authentication/magic-links-quickstart.html.
- Sign in page shows magic link option that works (sends email)
- Registration page shows the magic link option but it doesn’t send an email
I’ve setup the default sign_in_routes like this:
sign_in_route(
register_path: "/register",
reset_path: "/reset",
overrides: [KlipitPlatformWeb.AuthOverrides, AshAuthentication.Phoenix.Overrides.Default],
layout: {KlipitPlatformWeb.Layouts, :public},
on_mount: [{KlipitPlatformWeb.UserLiveAuth, :public}]
)
Is this by design or am I missing something?
Marked As Solved
jimsynz
I had to go back through the code - it looks like registration isn’t supported by magic link, although I imagine it would be pretty easy to add it. Feel free to open a feature request issue on the repo, or better yet a PR.
Also Liked
zachdaniel
water
I think magic links is a great concept, but will this handle ‘2nd device’ auth?
eg.
- You click the link on a computer.
- You open/click the email on your phone.
Now the session will happen on your phone, not on the computer?
Darth-Knoppix
Cheers for checking that!
I’ve had a look at the Ash Authentication repo and compared the password strategy with the magic links. I can see how it should work so I might give it a go if I get some time.
Last Post!
Darth-Knoppix
I definitely see this as a risk but it could be handled by messaging in the email or on the registration view like “Your magic link will log you in on the device you open it with, don’t share this with anyone”.
I haven’t seen any more sophisticated solutions to this in the wild but I’d be interested if you have ![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










