Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 2.83 KB

File metadata and controls

53 lines (39 loc) · 2.83 KB

Authentication Documentation

Quick reference guides for FlowStack authentication setup using Better Auth and @daveyplate/better-auth-ui.

Quick Links

Topic Description
Configuration ⭐ Centralized config reference (URLs, redirects, env vars)
Protected Routes Protect pages requiring authentication
OAuth Redirects Handle redirects after Google/social login
Adding Providers Add new OAuth providers (GitHub, Discord, etc.)
Cross-Domain Auth Multi-subdomain & cross-domain login
Email Templates Customize verification & reset emails
Troubleshooting Common issues and solutions

Key Files Overview

Configuration Files

File Purpose
apps/*/src/config/urls.ts Frontend/API URLs (APP_URLS)
apps/*/src/config/redirects.ts Frontend redirect paths
packages/auth/src/config/redirects.ts Backend redirect paths

Backend (packages/auth/)

File Purpose
src/auth.ts Main Better Auth configuration
src/email/*.ts Email sending functions
src/types.ts Environment variable types

Frontend (apps/web/ or apps/tanstack/)

File Purpose
src/lib/auth-client.ts Auth client configuration
src/providers.tsx AuthUIProvider setup
src/components/auth/ProtectedRoute.tsx Protect routes requiring authentication
src/pages/auth/*.tsx Auth page components

External References