Authenticate Users without the need for a password, forgot-password and reset-password. Less code, less emails and less users leaving because of forgoten passwords. xw
- Copy
.env.template
to ".env" - Add your enpoint url to
prisma/primsa.yml
- run
npm install
- run
npm run db
to setup the the database, generate client and run seed - start your server with "npm run dev"
- Open GraphQL Playground on
http://localhost:4000
- just run
npm start
NodeMailer is in use for now with ethereal.email
.
If you want something else, just edit the emails/sendEmail.js
and add your own settings / client
- Get
name
from email from the part before the@
symbol - Generate
slug
fromname
- Create User
- Continue with Login
- Create an
Auth
entry withtoken' and the
email` 1.1. with UUID token 1.2. with email the messages it was sent to - Generate a security to compare with the email (no fake emails)
- Click on link with
email
andtoken
- Check if
4.1. Auth entry with
token
exists 4.2.email
is correct 4.3. thecreatedAt
is not more then 1h ago - Generate JWT with
userId
- delete Auth entry