User Authentication

TheDevSpace boilerplate is shipped with a magic link user authentication system.

Magic link is a modern passwordless authentication mechanism, which involves sending a link to the user's inbox, and the user will be authenticated when they click on that link before it expires.

This modern authentication system is more secure, and is used in favour of traditional password systems.

The auth system is based on Auth.js, a widely used authentication library with an active community.

Usage

Auth.js requires an AUTH_SECRET environmental variable, which can be generated with the following command:

npx auth secret

Double check your .env file to make sure an AUTH_SECRET has been successfully created.

.env

AUTH_SECRET="5GNI5FL..."

Next step

Since the magic link system needs to send emails to the users, you must set up the email delivery system as well.

The new user will be created and saved in a database, so make sure to set up the database integration.