Skip to main content

Authentication Flow

The authentication flow consists of three screens that gate access to the protected (main) route group.

Screen Sequence


index.tsx — The Cold Start Screen

This is the atmospheric landing page shown on first launch. It performs a session check via authClient.useSession():
  • If session exists and user is at root (/): Immediately redirects to /(main)/commits via router.replace().
  • If no session: Renders the branded onboarding view with Reanimated entrance animations (FadeInDown, ZoomIn, FadeInUp) and a primary “Initialize Session” button.
  • Pathname guard: Redirect only fires when pathname === ”/”, preventing accidental stack resets when the app re-mounts from background while deep in sub-screens.

signin.tsx — The Sign-In Screen

A minimal screen that renders the AuthForm component over a programmatic SVG gradient background. The AuthForm handles both email/password and Google OAuth via Better Auth.

welcome.tsx — Post-Authentication Landing

Shown after successful authentication. Displays the user’s name from the active session and provides two actions: