Auth Routes

Authentication API endpoints.

Auth flow

Authentication is handled primarily through Supabase Auth client-side SDK. The server-side routes handle:

GET /auth/callback

OAuth callback handler. Processes the authorization code from Google OAuth and creates a session.

Sign in / Sign up

Authentication is handled client-side via Supabase Auth SDK:

import { getSupabaseClient } from '@/lib/supabase/client'
 
const supabase = getSupabaseClient()
 
// Email/password sign in
await supabase.auth.signInWithPassword({ email, password })
 
// Google OAuth
await supabase.auth.signInWithOAuth({
  provider: 'google',
  options: { redirectTo: `${origin}/auth/callback` },
})
 
// Sign up
await supabase.auth.signUp({ email, password })