Authentication Flow

User sign-in with OAuth providers

User Journey

Start

User Opens App

First-time launch or logged-out state

UI Component

Authentication Screen

  • App logo/branding
  • Welcome message
  • OAuth provider buttons:
    • Google
    • Apple
    • Microsoft
User Action

Select Provider

User clicks on Google, Apple, or Microsoft button

Controller

initiateOAuthFlow(provider)

Initiates OAuth flow with selected provider

External

OAuth Provider

User completes authentication with chosen provider

Controller

handleOAuthCallback(authToken, provider)

  • Validates authentication token
  • Creates or updates user record
Database

User Entity Created/Updated

  • User ID
  • Email address
  • Display name
  • OAuth provider
  • Provider user ID
  • Profile photo URL
  • Timestamps
Success

User Authenticated

User enters main app

Authentication Screen States

Default

Ready State

All provider buttons enabled and ready for selection

Loading

OAuth Flow Active

Loading indicator shown while processing authentication

Error

Authentication Failed

Error message displayed with retry option

Authentication Controllers

initiateOAuthFlow(provider)

Starts OAuth authentication process

handleOAuthCallback(authToken, provider)

Processes OAuth callback and creates user session

getCurrentUser()

Retrieves authenticated user from session

signOut()

Ends user session and clears auth state