E-FACTS — E-receipt management companyE-FACTS — E-receipt management company
Engineering

Auth & security boundaries

High-level auth model across docs, shopper API, and iOS — no secrets

Auth & security boundaries

High-level only. Never paste credentials, private keys, or production tokens into this handbook.

Three separate stories

SurfaceAuth model
Internal docsEmail/password cookie gate (DOCS_AUTH_*, cookie efacts_docs_session)
Shopper APIJWT access tokens; refresh rotation; optional Google id_token verify
iOS clientStores tokens in Keychain; unauthenticated → AuthPortalView

Docs auth is not shopper SSO and not enterprise IdP (unless added later).

Shopper auth (conceptual)

StepBehavior
Register / loginBackend issues access JWT
GoogleClient obtains Google credential → backend verifies → JWT
RefreshDedicated refresh endpoint; rotate / revoke on logout
API callsAuthorization bearer access token

Wallet bind (UCI / last4) is a sensitive server-validated flow — clients call APIs; they do not embed bind secrets.

Data handling rules

RuleWhy
Least privilegeClients get only what the screen needs
Zero-PAN mindsetDo not store or log full payment account numbers
Money as centsAvoid float rounding / injection-by-confusion
No secrets in MDX / Design.mdPublic-to-the-company ≠ public-to-the-internet forever

Docs gate details

See Local setup and root README for cookie attributes and env vars. Strengthen production with Vercel Deployment Protection.

On this page