Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 2.4 KB

File metadata and controls

87 lines (57 loc) · 2.4 KB

✅ FIXED: Profile Completion Issue

🔧 What Was Fixed

The profile completion wizard was blocking admin users from accessing the admin dashboard. I've updated the code so that admin users can bypass profile completion and go directly to /admin/dashboard.


🚀 What You Need to Do NOW

Step 1: Clear Your Browser Cache & Log Out

  1. Log out of your account
  2. Clear browser cache (or open an incognito/private window)
  3. Go to: https://rretoriq25.web.app

Step 2: Log Back In

  1. Log in with: agrahariprakhar086@gmail.com
  2. Your session will now have the admin: true claim

Step 3: Access Admin Dashboard

Go directly to: https://rretoriq25.web.app/admin/dashboard

You should now see:

  • Either the Institution Setup page (if no institution exists)
  • Or the Admin Dashboard (if institution already created)

⚠️ CRITICAL: Set Vercel Environment Variables

The admin dashboard UI will load, but API calls will fail until you set these:

Add these 3 variables (exact values in VERCEL_ENV_VARS.md):

Variable Name Value
FIREBASE_PROJECT_ID rretoriq25
FIREBASE_CLIENT_EMAIL firebase-adminsdk-fbsvc@rretoriq25.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY (See VERCEL_ENV_VARS.md)

🧪 Test It

  1. Log outLog back in
  2. Go to: https://rretoriq25.web.app/admin/dashboard
  3. You should see the admin interface
  4. Try creating an institution
  5. If API calls fail, check Vercel env vars

📊 Changes Made

File: src/components/ProtectedRoute.tsx

Change: Added admin bypass logic

// Allow admin users to bypass profile completion to access admin dashboard
if (user?.admin && location.pathname.startsWith('/admin')) {
  return <>{children}</>
}

This means:

  • ✅ Regular users still need to complete profile
  • ✅ Admin users can skip profile completion
  • ✅ Admin users can go directly to /admin/dashboard

🎯 Next Steps

  1. Log out and log back in (to refresh your auth token)
  2. Go to /admin/dashboard directly
  3. Set Vercel environment variables (for API to work)
  4. Create your institution and start adding students!

Frontend deployed: https://rretoriq25.web.app
Last deployed: Just now (October 11, 2025)