dd82dd3fea
Updated Electron window and session configuration to enhance Google OAuth sign-in compatibility, including user agent spoofing, session partitioning, and webview security settings. Added debugging for cookie changes and improved request headers for OAuth flows. Updated renderer code and index.html to use the new session partition and user agent. Added oauth-debug.md to document changes and troubleshooting steps.
1.8 KiB
1.8 KiB
Google OAuth Sign-in Debug Guide
Changes Made to Fix Google Sign-in Issues
1. Added Proper User Agent
- Set
useragentattribute on all webviews to identify as Chrome browser - User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Nebula/1.0.0
2. Enhanced Webview Security Configuration
- Added
webpreferencesattribute with proper security settings - Enabled JavaScript and maintained web security while allowing OAuth flows
3. Session Configuration for OAuth
- Configured session permissions for OAuth compatibility
- Added cookie change monitoring for Google domains
- Enhanced request headers for better OAuth compatibility
- Added referrer policy for OAuth flows
4. Unified Session Partitioning
- Changed all webviews to use
persist:mainpartition instead ofpersist:default - This ensures session data is shared across tabs for OAuth flows
Testing Google Sign-in
- Open the browser (already running)
- Navigate to any Google service (Gmail, YouTube, Drive, etc.)
- Click Sign In - you should now see the Google account picker
- Select your account - should take you to password/2FA screen
- Complete sign-in - should successfully sign you in
Debug Information
If issues persist, check the Console (F12) for:
- Cookie changes for Google domains
- OAuth redirect flows
- JavaScript errors
Common OAuth Issues Fixed
- ✅ Missing User Agent (Google blocks unidentified browsers)
- ✅ Third-party cookie restrictions
- ✅ Session isolation between tabs
- ✅ Missing referrer policies
- ✅ Popup blocking for OAuth flows
What Should Work Now
- Google account picker should appear
- Password entry screens should load
- Two-factor authentication should work
- OAuth redirects should complete properly
- Session should persist across tabs