Skip to content

OAuth-created accounts can violate the at-least-one-card invariant enforced elsewhere in the application #494

@Ridanshi

Description

@Ridanshi

Summary

Accounts created through OAuth onboarding can bypass the invariant that users should always possess at least one card.

This creates inconsistent account state compared to accounts created through standard onboarding flows.

Affected Files

  • auth.ts
  • cards.ts
  • onboarding.ts

Root Cause

OAuth onboarding and standard onboarding follow different account initialization paths.

The OAuth flow can complete without creating a default card or enforcing the invariant expected elsewhere in the application.

Reproduction

  1. Create a new account using OAuth.
  2. Inspect associated card records.
  3. Compare against accounts created through the normal onboarding flow.
  4. Observe missing default-card state.

Expected Behavior

All account creation paths should enforce identical card invariants.

Actual Behavior

OAuth-created accounts can exist without a card.

Why This Is Difficult To Detect

Most testing validates authentication rather than post-onboarding invariants.

Production Impact

  • Broken assumptions
  • Missing profile content
  • Downstream failures
  • Inconsistent account state

Suggested Fix

Enforce card initialization consistently across all account creation paths.

Severity

High

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions