Magic Links

Magic links are secure, time-sensitive URLs that enable passwordless authentication. When users request access, they receive a link via email that logs them in upon clicking. This eliminates the need for passwords, enhancing security and simplifying the user experience.

You can see the implementation below

https://github.com/madewithnovel/novel/blob/main/app/auth/passwordless.tsarrow-up-right

https://github.com/madewithnovel/novel/blob/main/app/api/internal/v1/auth-passwordless/index.tsarrow-up-right

You can create a different Magic Links flow by following this guide

Confugration

You will need to set up the after_login setting if you have changed the default page structure in Novel Web.

If you changed /web/app/(app)/dashboard to /web/app/(app)/apps for example, you will need to change the configuration in /config/auth.js .

API

You can use /auth/passwordless to perform a Magic Link flow.

Auth by Strategy

post

Authenticate by strategy available to the application.

Path parameters
strategystringRequired
Body
emailstring · emailOptional
passwordstringOptional
Responses
chevron-right
200

Authentication successful. Redirecting to next step...

application/json
post
/auth/{strategy}

Auth Passwordless

get

Authenticate by passwordless strategy available to the application.

Responses
get
/auth/passwordless/verify
301

Authentication successful. Redirecting to next step...

No content

Changelog

  • 2024-12-20 - Initial Documentation

Last updated