Skip to content

Authentication & Registration

RoutePurposeAuth Required
/sign-inUser loginNo (redirects to / if authenticated)
/sign-upNew account creationNo (redirects to / if authenticated)
/forgot-passwordPassword reset requestNo
/waiting-for-approveRegistration gate (private beta)Yes

  1. Email/Password - Form-based registration
  2. Google OAuth - One-click via signInWithGoogle()
FieldTypeRequiredValidation
firstNametextYesMin 1 character
lastNametextYesMin 1 character
emailemailYesValid email format
passwordpasswordYesMin 8 characters
agreeToTermscheckboxYesMust be true
  • URL: https://app.termly.io/policy-viewer/policy.html?policyUUID=0e8bd91c-0128-4955-8f7e-e17b7f697a2a
  • Opens in new tab
  • Must be accepted to register
  1. Firebase Auth account created
  2. Display name set as ${firstName} ${lastName}
  3. User document created at users/{uid}
  4. Referral signup processed (from cookie, silent failure)
  5. Analytics events fired
  6. Redirect to /
  7. Toast: “Account created successfully”
New user = (Date.now() - creationTime) < 5000ms

If new user detected via Google, referral tracking and sign_up event also fire.

EventWhenKey Data
sign_upSuccessful registrationmethod, user_id, email_domain, display_name
sign_up_failedRegistration errormethod, error_type
form_interactionField focus/blur/changeform_name, field_name, interaction_type
User properties setOn signupuser_type=new, signup_method, account_created_date

FieldTypeRequiredValidation
emailemailYesValid email format
passwordpasswordYesMin 8 characters
  • Success: Toast “Signed in successfully”, redirect to /
  • Failure: Toast with Firebase error message
  • Forgot password link: Navigates to /forgot-password
EventKey Data
sign_in_attemptmethod, page_location
sign_inmethod, user_id, is_new_user, email_domain
sign_in_failedmethod, error_type, error_message

  1. User navigates to /forgot-password
  2. Enters email address (required, valid format)
  3. Clicks “Send Email”
  4. Firebase Auth sends password reset email
  5. Toast: “Password reset email sent”
  6. Redirect to /sign-in

The actual password reset is handled by Firebase Auth’s native flow (not within the app).


Route: /waiting-for-approve

First 5 seconds: Loading animation with “Checking Account Status”

After loading:

  • “We’re in Private Beta” headline with badge
  • Two options:
    1. Have a Referral Code - Input field + “Link” button
    2. Join the Waitlist - Informational message
  1. User enters referral code (or code auto-detected from cookie)
  2. System validates code exists at referralCodes/{code} in Firestore
  3. If invalid: toast error “Invalid referral code”
  4. If valid:
    • Checks for duplicate at referrals/{code}_{userId}
    • Creates referral document at referrals/{code}_{userId}
    • Checks user registry limits at config/userRegistry
  5. Auto-approval logic:
    if (registry.enabled && registry.countCurrent < registry.limitUsers) {
    approve user, increment countCurrent
    } else {
    deny approval
    }
FieldValue
registrationApprovedtrue
waitingForApprovalfalse
isReferredtrue
referralIdreferral document ID
referralCodecode used
updatedAtTimestamp.now()

Path: referrals/{code}_{userId}

FieldValue
referralCodecode entered
referrerIdcode owner’s UID
refereeIdcurrent user’s UID
statusconverted
conversionEventsignup
metadata.signUpSourcewaiting-for-approve
metadata.signUpMethodreferral
  • Toast: “Referral code linked successfully! Redirecting…”
  • 2-second delay, then redirect to /

AuthGuard (requireAuth=true)
├── if route === "waiting-for-approve" → render directly
└── else:
├── CustomGuard #1: checkRegistrationApproved()
│ ├── FALSE → redirect to /waiting-for-approve
│ └── TRUE → continue
└── CustomGuard #2: checkOnboardingCompleted()
├── FALSE → redirect to /onboarding
└── TRUE → render app
  • checkRegistrationApproved() checks users/{uid}.registrationApproved === true
  • checkOnboardingCompleted() checks users/{uid}.onboardingCompleted === true
  • Both use server-side reads (getFromServer()) for latest data

On app load, cookieManager.initializeReferralTracking() runs:

  1. Extracts referralCode from URL query params
  2. Extracts UTM parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content)
  3. Saves to cookies with 90-day expiration (path /, SameSite Lax)
  4. Cleans tracking params from browser URL
CookieContentExpiration
referralCodeReferral code string90 days
referralDataJSON: {code, timestamp, source, utmParams}90 days

  • users/{uid} - User document with email, displayName, email metadata
  • users/{uid} - Updated with registrationApproved, referral fields
  • referrals/{code}_{uid} - Referral transaction record
  • config/userRegistry - countCurrent incremented
  • Analytics properties and events only (no Firestore writes)