Skip to content

Latest commit

 

History

History
165 lines (108 loc) · 3.26 KB

File metadata and controls

165 lines (108 loc) · 3.26 KB

Demo Mode Fix - Login Issue Resolved

Issue: Users couldn't login and were seeing "Google login not available in demo mode"

Date Fixed: October 8, 2025


Problem

The deployed application was stuck in demo mode, preventing normal login functionality. Users were seeing the demo login page instead of the regular login page with Google authentication.

Root Cause:

  • The app checks for REACT_APP_DEMO_MODE environment variable
  • No environment variables were set in Vercel
  • When undefined, the app behavior was inconsistent

Solution Applied

1. Added Environment Variable to Vercel

# Set REACT_APP_DEMO_MODE to false for production
vercel env add REACT_APP_DEMO_MODE production
# Value: false

2. Verified Environment Variable

vercel env ls

Result:

name                   value       environments    created
REACT_APP_DEMO_MODE    Encrypted   Production      13s ago

3. Redeployed to Production

vercel --prod

New Production URL: https://client-qfxiss8tj-aarifs-projects-a2bd2db2.vercel.app


How It Works

App.js Logic:

const isDemoMode = process.env.REACT_APP_DEMO_MODE === 'true';

<Route 
  path="/login" 
  element={isDemoMode ? <DemoLogin /> : <Login />} 
/>

Now:

  • Production: REACT_APP_DEMO_MODE=false → Users get regular <Login /> page with Google auth
  • Demo: Set to true if you want demo mode

Login Options Now Available

1. Regular Login (Production)

Email/Password authenticationGoogle OAuth login (if configured) ✅ Full user registration

2. Demo Login (When REACT_APP_DEMO_MODE=true)

Demo credentials for testing:


Environment Variable Management

View All Environment Variables:

vercel env ls

Add New Environment Variable:

echo "your-value" | vercel env add VARIABLE_NAME production

Remove Environment Variable:

vercel env rm REACT_APP_DEMO_MODE production

Pull Environment Variables Locally:

vercel env pull

Testing the Fix

  1. Visit: https://client-qfxiss8tj-aarifs-projects-a2bd2db2.vercel.app
  2. Click "Login" or go to /login
  3. You should now see the regular login page with:
    • Email/Password fields
    • Google login button (if Firebase is configured)
    • Register link

Additional Notes

If You Want Demo Mode Back:

# Update the environment variable
echo "true" | vercel env add REACT_APP_DEMO_MODE production

# Redeploy
cd client
vercel --prod

For Local Development:

Create a .env.local file in the client directory:

REACT_APP_DEMO_MODE=false

Deployment History

Time URL Status Mode
Now client-qfxiss8tj ✅ Ready Production (Demo OFF)
5m ago client-nd6iyg569 ✅ Ready Unknown (Demo state unclear)
45m ago client-8d134yx51 ❌ Error Build failed

Status: ✅ RESOLVED

Demo mode has been disabled. Users can now use regular login with full authentication features.

Live URL: https://client-qfxiss8tj-aarifs-projects-a2bd2db2.vercel.app