This repository demonstrates how to extend mix phx.gen.auth's default capabilities by adding "magic link" authentication. That is, one-time sign-in links delivered to your email.
Visit John Elm Lab's Writeup for more info.
To start the Phoenix server:
- Run
asdf installto install the correct elixir and erlang versions - Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
To demonstrate the sign-in flow:
- Create an account at http://localhost:4000/users/register
- Log out of the account (Sign out button at top right of home page)
- Navigate to http://localhost:4000/users/log_in
- Enter email and click "Send me a link"
- Navigate to the mailbox http://localhost:4000/dev/mailbox and find the magic link email
- Navigate to the sign in URL contained in the email
- Done!