🔐 SaaSFast uses the NextAuth library for user authentication¶
You can configure it in the file:
/app/api/auth/[...nextauth]/route.js
⚙️ Setup¶
1️⃣ If you haven’t already, add the following values to your .env.local
file:
💻 There is a code block here
🔑 NEXTAUTH_SECRET
is a random string used to encrypt JWT.
Use any value that is at least 15 characters long.
2️⃣ If you haven’t set up email sending/receiving yet, do that first.
3️⃣ In the config.js
file, add a from
field to resend.fromNoReply
📧 (Usually something like noreply@mail.yourdomain.com
)
4️⃣ (Skip this if you are using Resend)
🚫 Add a sending limit in Mailgun to prevent abuse.
5️⃣ The MongoDB adapter saves new users to the database when they click the login link received via email.
🗃️ Make sure your database is properly configured first.