Authentication
Boilerbay uses NextAuth.js (opens in a new tab) for authentication. You can find the configuration in the src/lib/auth.ts
file.
Run the following command to generate next-auth secret:
openssl rand -base64 32
Copy the secret and add it to the .env.local
file:
NEXTAUTH_SECRET=
Also update the NextAuth URL in the .env.local
file:
NEXTAUTH_URL=http://localhost:3000
Replace the URL with your own domain when deploying to production.
Magic links & Google OAuth are enabled by default. You can enable other providers by following the NextAuth.js documentation (opens in a new tab).
Google OAuth
In order to use Google OAuth, you need to create a project in the Google Developer Console (opens in a new tab). Then, add the following environment variables to the .env.local
file:
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
Magic Links
For Magic links, we use Resend (opens in a new tab) to send emails. You can configure Resend in src/lib/resend.ts
.
Get your Resend API key from the Resend API KEY (opens in a new tab) and add it to your .env.local
file:
RESEND_API_KEY=
Now for the send email functionality to work, you need to add your domain to the Resend domains (opens in a new tab).
Now for STMP to work, get your SMTP credentials from the Resend SMTP (opens in a new tab) and add them to your .env.local
file:
EMAIL_SERVER_USER=
EMAIL_SERVER_PASSWORD=
EMAIL_SERVER_HOST=
EMAIL_SERVER_PORT=
EMAIL_FROM=your-domain-name.com