5.4 KiB
5.4 KiB
Mobile Login Issue - Troubleshooting Guide
Issue
Users can login on desktop but not on mobile devices.
Common Causes & Solutions
1. Private/Incognito Browsing Mode ⚠️ MOST COMMON
Problem: Mobile browsers in private/incognito mode often block sessionStorage and localStorage
Solution:
- Exit private/incognito mode
- Use normal browsing mode
- The app will now display a warning if storage is blocked
2. Browser Storage Settings Disabled
Problem: Some mobile browsers have storage/cookies disabled in settings
Solution for iOS Safari:
- Open Settings > Safari
- Enable "Block All Cookies" should be OFF
- Enable "Prevent Cross-Site Tracking" can be ON
- Refresh the app
Solution for Android Chrome:
- Open Chrome > Settings > Site Settings
- Cookies > Allow
- Refresh the app
3. CryptoJS Library Loading Issue
Problem: The encryption library might not load properly on slow mobile connections
Solution:
- Wait for the page to fully load (watch for network indicator)
- Refresh the page (pull down on mobile)
- Clear browser cache
- Check your internet connection
4. Form Submission Issues on Mobile
Problem: Mobile keyboards might interfere with form submission
Solution:
- Make sure to press the "Login" button, not the keyboard's "Go/Enter" button
- Try closing the keyboard first, then tap Login
- Updated code now better handles mobile form submissions
Quick Diagnostic Tool
Access the Debug Page
- Navigate to:
http://your-server:3000/mobile-login-debug.html - Or add
/mobile-login-debug.htmlto your app URL - Run all tests to identify the exact problem
What the Tests Check
- ✅ Browser capabilities
- ✅ Storage availability (localStorage & sessionStorage)
- ✅ CryptoJS library loading
- ✅ Password hashing
- ✅ Login simulation
Default Credentials
- Username:
hop - Password:
hop@2026ilovejesus
Recent Code Improvements
Enhanced Error Messages
The login page now shows specific error messages:
- "Encryption library not loaded. Please refresh the page."
- "Storage error: Please ensure cookies/storage is enabled and not in private browsing mode."
- "Invalid username or password"
Early Detection
The app now checks for issues when the login page loads:
- Verifies CryptoJS is loaded
- Tests localStorage accessibility
- Tests sessionStorage accessibility
- Displays warnings before you try to login
Console Logging
Open browser console (Chrome DevTools on desktop, or use remote debugging) to see:
- Login attempt details
- Hash comparison results
- Storage operation status
- Specific error messages
Testing on Mobile
Using Desktop Browser (Chrome DevTools)
- Open Chrome DevTools (F12)
- Click "Toggle Device Toolbar" (Ctrl+Shift+M)
- Select a mobile device
- Test login functionality
- Check Console tab for errors
Using Real Mobile Device
- Navigate to the app on your phone
- Try to login
- Note any error messages
- Try the debug page:
/mobile-login-debug.html - Share test results for further diagnosis
How to Enable Console on Mobile
iOS Safari
- Settings > Safari > Advanced > Web Inspector (ON)
- Connect iPhone to Mac
- Safari (Mac) > Develop > [Your iPhone] > [Page]
Android Chrome
- Enable Developer Options on phone
- Enable USB Debugging
- Connect to computer
- Chrome desktop:
chrome://inspect - Select your device
Force Refresh on Mobile
iOS Safari
- Hold the refresh button
- Select "Request Desktop Site"
- Or: Close Safari completely and reopen
Android Chrome
- Settings (three dots) > Settings
- Advanced > Site Settings
- Storage > Clear browsing data
- Select "Cached images" and clear
Technical Details
Authentication Flow
- User enters credentials
- Password is hashed using SHA-256 (CryptoJS)
- Hash is compared with stored hash
- On success:
sessionStorage.setItem("authenticated", "true")sessionStorage.setItem("authTime", timestamp)sessionStorage.setItem("sessionId", uniqueId)
- Session valid for 24 hours
Why Mobile Might Fail
- sessionStorage blocked - Private mode, strict browser settings
- CryptoJS not loaded - Slow network, CDN blocked, script blocker
- Form submission blocked - Mobile keyboard interaction
- Cache issues - Old JavaScript files cached
Contact Support
If issues persist after trying these solutions:
- Run the debug page tests
- Take screenshots of any errors
- Note your device/browser (iPhone Safari, Android Chrome, etc.)
- Share console errors if possible
- Try a different browser as a test
Files Modified
/frontend/src/App.js
- Added system warning detection on mount
- Enhanced error messages with specific causes
- Added console logging for debugging
- Better sessionStorage error handling
- Verification that storage operations succeed
/frontend/public/mobile-login-debug.html
- New diagnostic tool
- Tests all system capabilities
- Simulates login process
- Shows exact failure points
Next Steps
- Try the debug page first: Access
/mobile-login-debug.htmlon mobile - Check for warnings: Look at the orange warning banner on login page
- Disable private mode: Most common fix
- Try different browser: Test if it's browser-specific
- Clear cache: Force fresh download of all files
Last Updated: December 16, 2025 Version: 1.0