ViewsAuth Views

Auth Views

LoginView

File: Views/Auth/LoginView.swift

The login screen with email/password form and social sign-in buttons.

Login Screen

Features

  • Email and password text fields
  • “Sign In” and “Create Account” buttons
  • “Sign in with Apple” button (native ASAuthorizationButton)
  • “Sign in with Google” button
  • Error message display
  • Loading state indicator

Flow

  1. User enters credentials or taps social login
  2. AuthViewModel handles authentication
  3. On success, navigates to ContentView (tabs)
  4. On failure, shows error message

AppleSignInButton

File: Views/Auth/AppleSignInButton.swift

Wraps the native ASAuthorizationAppleIDButton in a SwiftUI view. Uses AppleSignInDelegate to manage the ASAuthorizationController flow.

Sign-In Process

  1. Presents native Apple Sign In sheet
  2. User authenticates with Face ID / Touch ID
  3. Returns ASAuthorization with identity token
  4. Token is passed to Supabase Auth via signInWithIdToken
  5. Supabase creates/matches user account
  6. Profile trigger creates profiles row