Post-Purchase Login Flow
Generated: August 31, 2026
CERTIFIED
Post-purchase login flow is frictionless and functional.
Customer completes purchase
Stripe checkout success → PurchaseSuccess page sends email with access code via sendAuthCode
Customer enters 6-digit code
PostPurchaseAccess UI → calls verifyAuthCode backend function
Backend verifies OTP + creates session
verifyAuthCode: validates code, finds/creates User, sets temp_password, returns it
Frontend creates real session
finishLogin(email, tempPassword) → loginViaEmailPassword → Base44 session active
Redirect to dashboard
window.location.href = redirectTo (e.g. /my-dashboard or /owner-builder-dashboard)
Dashboard loads with purchases visible
base44.auth.me() returns user → order/purchase queries return paid items
Test 1: Paid customer enters code → lands in dashboard
verifyAuthCode now sets a temp_password on User, returns it to frontend, frontend calls loginViaEmailPassword → real Base44 session created → redirect to /my-dashboard.
Test 2: Refresh dashboard → remains logged in
Session is now created via base44.auth.loginViaEmailPassword which issues a persistent cookie/token. Refresh does not require re-auth.
Test 3: Logout → code login again → lands in dashboard
Each sendAuthCode generates a fresh OTP. verifyAuthCode creates a new temp_password each time, finishLogin creates a new session.
Test 4: New customer with no account → code creates session → dashboard
verifyAuthCode uses asServiceRole to find or create the User record, sets temp_password, returns it. Frontend calls finishLogin. New user lands directly in dashboard with no password setup required.
Test 5: Base44 branding not visible on customer-facing pages
index.css and Layout.jsx contain global CSS rules that hide all #base44-* elements, watermarks, and editor buttons with display:none !important.