Source:
ocean/supabase/README.md| ✏️ Edit on GitHub
Supabase Configuration
This directory contains the Supabase configuration for Ocean.
Authentication Configuration
The application is configured to use OTP (One-Time Password) email verification instead of magic links.
Key Configuration Settings
-
OTP Email Verification
- OTP Length: 6 digits
- OTP Expiry: 300 seconds (5 minutes)
- Email confirmations are required
- Magic links are disabled
-
Email Templates
templates/confirmation.html- Sent when a new user signs uptemplates/magic_link.html- Sent for OTP verification (despite the name, it sends OTP codes)templates/recovery.html- Sent for password reset requests
Configuration Files
config.toml- Main Supabase configuration filemigrations/- Database migrations for auth settingstemplates/- Email templates for OTP emails
How OTP Works
- When a user signs up, they receive an email with a 6-digit OTP code
- The user enters this code on the verification page
- The code is validated using
supabase.auth.verifyOtp() - Upon successful verification, the user is logged in
Updating Configuration
To modify OTP settings:
-
Update the
config.tomlfile:[auth.email]section for email-specific settingsotp_lengthto change code lengthotp_expiryto change expiration time (in seconds)
-
Update email templates in the
templates/directory to customize the appearance -
Run migrations if database-level changes are needed
Testing Locally
When running Supabase locally with supabase start, emails are captured by Inbucket (email testing server) at:
- Web interface: http://localhost:54324
This allows you to view OTP codes without actually sending emails during development.