Flows category icon
Debugging
Intermediate

Fix Fake Auth

Your login 'works' but nothing is real: convert visual-only auth into persisted users, sessions, and guards.

6 steps18 verify checks45-90 minutesWorks with: emergent · chatgpt · claude · cursor
Start Guided Walkthrough

The Route

0/6 verified

Context Pack

Paste this first. It briefs the AI on requirements, constraints, and the Definition of Done before your first build prompt.

Context Pack
PROJECT CONTEXT:
My app has signup/login screens that appear to work but do not create real users or protect anything.

GOAL:
Replace fake auth with real user records, credential verification, persistent sessions, and enforced route protection.

REQUIREMENTS:
- Signup creates real persisted user records
- Login verifies against stored hashed passwords
- Sessions survive refresh
- Protected routes and APIs actually reject the logged-out
- Visible error states everywhere

CONSTRAINTS:
- No plaintext passwords
- No auth state living only in a React variable
- Backend endpoints must enforce auth independently of the UI

DEFINITION OF DONE:
- A created user exists in the database with a hashed password
- Wrong credentials fail visibly; right ones succeed
- Refresh keeps the session
- Direct URL access to protected pages redirects when logged out

COMMON FAILURES TO AVOID:
- Login that accepts any credentials
- Auth state in memory only, gone on refresh
- Protected pages reachable by URL
- APIs serving private data without any session check

Paste this into your AI builder first. It teaches the AI what you want before you give it the build prompt.

Related routes

More Debugging flows that share ground with this one.

Flows category icon
Debugging

Add Database Persistence

Your app forgets everything on refresh: move state into a real database with working CRUD.

01Inventory unpersisted state
02Design models and endpoints
03Wire writes to the backend

+2 more steps to Done

Best foryour first pass at this - no prior setup assumed

5 steps45-75 minutesBeginner
Flows category icon
Debugging

Add Loading/Error States

Eliminate silent failures and frozen screens: add loading, empty, and error states across the whole app.

01Inventory async surfaces
02Add loading states
03Add error states with retry

+2 more steps to Done

Best foryour first pass at this - no prior setup assumed

5 steps30-60 minutesBeginner
Flows category icon
Debugging

Fix App That Looks Good But Does Not Work

The systematic recovery flow for beautiful-but-broken AI builds: audit honestly, then fix by functional priority.

01Run a brutal functional audit
02Prioritize the fix order
03Fix the core value action

+3 more steps to Done

Best forbuilders who have shipped a basic app before

6 steps60-120 minutesIntermediate

Made with Emergent