Videa Docs

Auth Providers

Configure authentication providers for your app.

Email + Password

Enabled by default. Users register with email, name, and password.

Email Verification

Email verification is required by default. Configure in lib/auth.ts:

emailAndPassword: {
  enabled: true,
  requireEmailVerification: true,
}

Password Reset

The password reset flow:

  1. User requests reset at /forgot-password
  2. System generates a token (stored in passwordResetToken table, expires in 1 hour)
  3. Reset email is sent with a link
  4. User sets new password at /reset-password?token=...

Google OAuth

Google login is optional. The starter only enables the provider when both AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET are configured.

Setup

  1. Create OAuth credentials at Google Cloud Console
  2. Set authorized redirect URI to: {YOUR_URL}/api/auth/callback/google
  3. Add to .env:
AUTH_GOOGLE_ID="your-client-id"
AUTH_GOOGLE_SECRET="your-client-secret"

Adding More Providers

Better Auth supports many OAuth providers. To add GitHub, for example:

  1. Install the provider (if needed)
  2. Add to socialProviders in lib/auth.ts:
socialProviders: {
  google: { ... },
  github: {
    clientId: process.env.AUTH_GITHUB_ID!,
    clientSecret: process.env.AUTH_GITHUB_SECRET!,
  },
}
  1. Add the login button in features/auth/components/

On this page