Skip to main content

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

  1. OTP Email Verification

    • OTP Length: 6 digits
    • OTP Expiry: 300 seconds (5 minutes)
    • Email confirmations are required
    • Magic links are disabled
  2. Email Templates

    • templates/confirmation.html - Sent when a new user signs up
    • templates/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 file
  • migrations/ - Database migrations for auth settings
  • templates/ - Email templates for OTP emails

How OTP Works

  1. When a user signs up, they receive an email with a 6-digit OTP code
  2. The user enters this code on the verification page
  3. The code is validated using supabase.auth.verifyOtp()
  4. Upon successful verification, the user is logged in

Updating Configuration

To modify OTP settings:

  1. Update the config.toml file:

    • [auth.email] section for email-specific settings
    • otp_length to change code length
    • otp_expiry to change expiration time (in seconds)
  2. Update email templates in the templates/ directory to customize the appearance

  3. 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:

This allows you to view OTP codes without actually sending emails during development.

Trigger deployment