Email Verification

Confirm that users own the email address they registered with using a secure token sent by Koolbase.

How it works

1

User registers — account is created with verified: false

2

Your app calls sendVerificationEmail() — Koolbase sends a one-time token to the user's email

3

User clicks the link — your app receives the token from the deep link

4

Your app calls verifyEmail(token) — account is marked verified: true

Send verification email

Call after registration, or when a user requests a resend:

lib/auth.dartDart
await Koolbase.auth.sendVerificationEmail(
  email: 'user@example.com',
);
// Koolbase sends a token to the user's email

Email provider

Verification emails are sent via the email provider configured in your Koolbase project settings. Make sure you have configured your EMAIL_FROM address in the dashboard before going to production.

Deep linking the verification email

The link in the verification email points wherever you configure your project's Verification URL under Email Branding in the dashboard. Koolbase substitutes {token} with the actual token at send time.

Common URL patterns
Universal Link (recommended for production)
  https://yourdomain.com/verify?token={token}

Custom scheme (simpler, dev-friendly)
  myapp://verify?token={token}

Universal Links vs custom schemes

Universal Links (iOS) and App Links (Android) are https URLs your app claims via apple-app-site-association and assetlinks.json hosted on your domain. They open your app when installed and fall back to a web page when it isn't — the right choice for production.

Custom schemes like myapp:// need no domain setup but have no web fallback, and some mail clients strip them. Fine for development or internal builds.

Without a configured URL

If you don't set a Verification URL in the dashboard, the link in the email falls back to a Koolbase dashboard URL that won't reach your app. Configure this before going to production.

When the user taps the link, your deep link handler extracts the token query parameter and passes it to verifyEmail() — same code path regardless of which link mechanism you chose. See the next section.

Verify the token

When the user clicks the verification link in their email, your app receives the token via deep link. Pass it to verifyEmail():

lib/auth.dartDart
// token comes from your deep link handler
final token = Uri.parse(incomingLink).queryParameters['token'];

await Koolbase.auth.verifyEmail(token: token!);

// User is now verified
final user = await Koolbase.auth.currentUser();
print(user?.verified); // true

Check verification status

lib/auth.dartDart
final user = await Koolbase.auth.currentUser();

if (user != null && !user.verified) {
  // Show verification reminder banner
  showBanner('Please verify your email to continue.');
}