How to set up email verification flow using Authverse.
Authverse allows you to easily add email verification to your authentication flow.
Execute the following command:
npx authverse@latest verifyThis command automatically:
auth.ts to enable requireEmailVerification.auth.ts.EmailVerification email template.When enabled, users will receive a verification email upon sign up. You can customize the behavior using the options in auth.ts:
emailVerification: {
sendVerificationEmail: async ({ user, url }) => {
// ... sending logic
},
sendOnSignUp: true, // Send email when user signs up
sendOnSignIn: true, // Send email when user signs in (if not verified)
},This feature relies on the generic email integration. If you haven't set up an email provider yet, the CLI will prompt you to do so. See Email Integration for details.