Appearance
Magic Link Login ✨
A Magic Link is a password-free login method that allows users to access their accounts by clicking a unique link sent to their email or phone. This approach not only simplifies the login process but also enhances security, as users don't need to remember or manage passwords. 🔐
Setting Up Magic Link Login
Follow these steps to enable Magic Link login for your project:
Navigate to
Settings -> Login Providers
. This will bring you to the login provider management screen, as shown below.Toggle the Magic Link switch to either enable or disable this login method. Once enabled, the option to log in via Magic Link will appear on your login page.
That's it! 🎉 Now your users can log in quickly and securely using a magic link sent to their email or phone. 📩
Setting the Expiry Time for Magic Links ⏳
By default, magic links are valid for a 10 mins. You can adjust the expiry time for magic links by updating the MAGIC_LINK_EXPIRY
variable in your .env
file. This value should be set in minutes.
For example, to set the magic link expiry to 30 minutes, you would add:
bash
MAGIC_LINK_EXPIRY=30
TIP
To maintain a balance between user convenience and security, carefully set a magic link expiration time. Shorter expiration times are generally more secure but they may impact user experience.
Enabling Magic Links makes the login process smoother and more user-friendly, reducing the friction of password management and maintaining robust security. 🌟