Skip to content

How to add Magic Link Authentication to the phx.gen.auth generator code.

Notifications You must be signed in to change notification settings

srcrip/phoenix-magic-links

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magic Links Example for Phoenix

Click here for a link to the most useful commit


This repo is a reference for setting up a comprehensive Magic Link solution in Phoenix, based off of Phoenix's phx.gen.auth generator. This reference will be useful for you, assuming that:

  1. You have started a new Phoenix project, or have an existing one.
  2. You have ran the phx.gen.auth generator (this project assumes you ran mix phx.gen.auth Users User users, but you can adjust the context or schemas accordingly).
  3. You want to add sign-in with magic links.
  4. You do not want any password handling code left over. Your app will only use emails (but maybe you want to add social auth or something, but not passwords).

The best way to use this as a reference would be to just refer to this commit. This has all the changes you need to implement in your own project. You can refer back to this commit as a starting point in new projects.

This work is an extension of this post. I like what @JohnElmLabs showed off in this post, but I wanted to extend it and show the result, in particular showing what you can remove from the authentication generator.

About

How to add Magic Link Authentication to the phx.gen.auth generator code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published