Documentation Index
Fetch the complete documentation index at: https://thenile.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Email verification helps confirm user identities by requiring them to verify their email addresses before gaining full access. This is especially useful for preventing spam and unauthorized access. When a user signs up, Nile Auth:- Sends a verification email using your configured SMTP server.
- Generates a unique
verification_tokenfor the user. - Grants access to the user after they click the verification link.
Prerequisites
- A configured SMTP server is required to send verification emails. You can set this up in the Nile Auth UI under Tenants & Users -> Configuration -> Email templates.
- A web server configured to handle Nile Auth requests and serve html.
Implementation
Your application must expose API routes to handle authentication operations.Create a folder called Create following files handle the calls to your server, as well as expose the
api under the app folder and a folder called [...nile] under it:nile instance to your application:app/api/[...nile]/nile.ts
app/api/[...nile]/route.ts
Middleware for Verification Enforcement
Verification Button in the Frontend
Verification flow
- The user inputs their email on the login/signup page.
- Nile sends an email with a verification token using the configured SMTP settings.
- The link exchanges the
verification_tokenfor an authenticated session. - Upon successful verification, the user can access the application.
Related Topics
- Email Templates - Customize email verification messages.
- Custom SMTP - Configure your own SMTP server for sending emails.
- User Management - Manage user accounts in Nile Auth.