Open the test-auth.html file in your browser to test the authentication system, or go directly to Login/Choose_login.html to use the login page.
- Email:
admin@officer.com - Password:
Test@1234(or any password) - Result: You'll be redirected to the Officer Dashboard
- Email:
worker@worker.com - Password:
Worker@123(or any password) - Result: You'll be redirected to the Worker Dashboard
- Email:
yourname@gmail.com(or any Gmail/Yahoo/personal email) - Password:
User@1234(or any password) - Result: You'll be redirected to the User Dashboard
Once logged in, you can:
- ✅ See your name and email displayed
- ✅ Access dashboard features
- ✅ Sign out (redirects to login)
- ✅ Try accessing other dashboards (you'll be redirected back to your correct dashboard)
The system automatically analyzes your email and routes you:
Email Domain → Dashboard Type
─────────────────────────────────────────────
@officer.com, @office.com → Officer Dashboard
@worker.com → Worker Dashboard
@gmail.com, @yahoo.com, → User Dashboard
@outlook.com, etc.
Open this file for an interactive testing interface where you can:
- Test email detection without logging in
- See which dashboard each email type leads to
- Quick login with pre-filled credentials
- View current authentication status
-
Test Officer Login:
Email: jeeva@officer.com Password: (anything) Expected: Officer Dashboard -
Test Worker Login:
Email: ramesh@worker.com Password: (anything) Expected: Worker Dashboard -
Test User Login with Gmail:
Email: jeeva@gmail.com Password: (anything) Expected: User Dashboard -
Test User Login with any domain:
Email: anything@anydomain.com Password: (anything) Expected: User Dashboard (default)
Each dashboard is protected:
- If not logged in: Redirected to login page
- If wrong user type: Redirected to correct dashboard
- If correct user type: Full access granted
Example:
Worker tries to access Officer Dashboard
→ System detects user type = "worker"
→ Automatically redirects to Worker Dashboard
- At least 8 characters
- Must include uppercase letter (A-Z)
- Must include lowercase letter (a-z)
- Must include number (0-9)
- Must include special character (!@#$%^&*)
- Use the test file (
test-auth.html) to understand the system - Try different email domains to see routing behavior
- Test dashboard protection by manually navigating to wrong dashboards
- Check browser console for detailed logs
To log out and test again:
- Click "Sign Out" in the dashboard
- Or open browser DevTools → Application → Local Storage → Clear all
Road damage/
├── auth.js # Core authentication system
├── test-auth.html # Testing interface
├── LOGIN_SYSTEM_GUIDE.md # Detailed documentation
├── QUICKSTART.md # This file
├── Login/
│ └── Choose_login.html # Login page
└── Dashboard/
├── Officer.HTML # Officer dashboard (protected)
├── Worker.HTML # Worker dashboard (protected)
└── User.HTML # User dashboard (protected)
Solution: Make sure you're opening the HTML files from the correct directory structure and that auth.js is in the parent folder.
Solution: Check your email domain. The system routes based on email pattern (see the mapping above).
Solution:
- Open browser console (F12)
- Check for error messages
- Verify
auth.jsis loaded - Try the test page first (
test-auth.html)
Solution: Check that all dashboard files exist in the Dashboard/ folder with correct names (Officer.HTML, Worker.HTML, User.HTML).
After testing the authentication:
-
Customize Email Domains:
- Edit
auth.js - Modify the
AUTH_CONFIG.userTypesobject - Add your organization's email domains
- Edit
-
Add Real Backend:
- Currently, any password works (demo mode)
- Implement actual password verification
- Add database for user storage
- Use JWT tokens for security
-
Enhance Security:
- Add password hashing
- Implement session timeouts
- Add two-factor authentication
- Use HTTPS in production
- Check
LOGIN_SYSTEM_GUIDE.mdfor detailed documentation - Open
test-auth.htmlto understand email routing - Check browser console for error messages
- Verify file paths and structure
Ready to test? Open test-auth.html or Login/Choose_login.html and start exploring! 🎉