You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full MERN Stack application with Google OAuth 2.0 authentication for managing Skill Faculties and Dean accounts in a university placement system.
🔐 How Authentication Works
User visits /login
↓
Clicks "Sign in with Google"
↓
Google returns ID token (credential)
↓
Frontend sends token to POST /api/auth/google
↓
Backend verifies token with Google
↓
Checks if email exists in MongoDB
↓
If NOT found → 403 "Access denied"
If found → Returns JWT token
↓
Frontend stores JWT in localStorage
↓
Redirects based on role:
super_admin → /admin/dashboard
dean → /dean/dashboard
👤 User Roles
Super Admin
Pre-seeded in DB via SUPER_ADMIN_EMAIL env variable
Can create, edit, delete Skill Faculties
When a faculty is created, the dean's email is auto-registered
Dashboard shows all faculties with stats
Dean
Created automatically when Super Admin adds a Skill Faculty
Can login with their Google account using the registered email
Dashboard shows their faculty details, departments, and placement portal
🏫 Skill Faculties
Supported faculty codes (any code works, these are examples):
Code
Full Name
SFET
Skill Faculty of Engineering & Technology
SFASH
Skill Faculty of Arts, Science & Humanities
SFMSR
Skill Faculty of Management, Social Science & Research