Darth-Knoppix

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 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

jimsynz

Ash Core Team

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

zachdaniel

Creator of Ash

Interesting. I haven’t actually set up the magic link strategy myself, so @jimsynz will probably need to chime in on this front.

water

water

I think magic links is a great concept, but will this handle ‘2nd device’ auth?

eg.

  1. You click the link on a computer.
  2. You open/click the email on your phone.

Now the session will happen on your phone, not on the computer?

Darth-Knoppix

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

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 :thinking:

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement