-
Notifications
You must be signed in to change notification settings - Fork 2k
Improve log in handling for Google #102018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~14 bytes added 📈 [gzipped]) DetailsCommon code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the social authentication flows by updating the logout handling, refining error handling in Google auth callback, and simplifying the authentication nonce generation for Apple logins.
- Replace logoutUser with redirectToLogout for consistent logout behavior.
- Modify error handling in Google auth callback to silently ignore user existence errors.
- Simplify Apple authentication by using a locally generated nonce.
| notice: { | ||
| status: 'is-warning', | ||
| text: 'Could not complete Google login. Please try again.', | ||
| // Silently fail: user already exists |
Copilot
AI
Mar 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The catch block in jetpackGoogleAuthCallback silently swallows all errors, which may mask unexpected issues. Consider filtering errors to only ignore the specific 'user already exists' case or log other errors for debugging purposes.
| // Silently fail: user already exists | |
| if (createError.message.includes('user already exists')) { | |
| // Silently fail: user already exists | |
| } else { | |
| console.error('Unexpected error during user creation:', createError); | |
| } |
This reverts commit 30b8af0.
* Revert "Properly handle redirect_to in fallback login page (#102117)" This reverts commit 24f8f5e. * Revert "Jetpack Onboarding: various auth improvements (#102106)" This reverts commit da747fd. * Revert "Improve error handling in auth flows (#102027)" This reverts commit fd52d8c. * Revert "My Jetpack: redirect logged in users to the connection page (#102644)" This reverts commit 6a41e3e. * Revert "Improve log in handling for Google (#102018)" This reverts commit 30b8af0. * Revert "Add back logging out (#102015)" This reverts commit 54afb7e. * Revert "Fix Apple and GitHub redirects (#102011)" This reverts commit f39b9e4. * Revert "Next bunch on auth improvements (#101996)" This reverts commit 3de680b. * Revert "Various improvements of direct Jetpack auth (#101988)" This reverts commit 7a3558a. * Revert "Improve error redirects (#101865)" This reverts commit e2c6064. * Revert "MARTECH-42 Various Jetpack direct auth improvements and fixes (#101859)" This reverts commit d49fc76. * Revert "Add direct GitHub auth and callback server-side (#101672)" This reverts commit bec8c74. * Revert "Do not run Jetpack social auth endpoints on serverside (#101832)" This reverts commit 2d915a9. * Revert "Remove oauth env checks in social auth Jetpack (#101802)" This reverts commit 0639270. * Revert "Revert the improvement to the original code (#101801)" This reverts commit d959108. * Revert "Fix nonce handling in auth request (#101800)" This reverts commit 013bd4e. * Revert "JPMT-31 Apple authentication endpoint for Jetpack (#101658)" This reverts commit 0c55e09. * Revert "JPMT-30 Add direct Google auth endpoint for Jetpack (#101588)" This reverts commit 93dbf58. * Revert "Support auto trigger of magiclink auth (#101601)" This reverts commit 2984e31. * Revert "JPMT-29 Improve Google Auth handling based on testing (#101508)" This reverts commit 7011770. * Revert "JPMT-29 Add direct authentication endpoints for social providers (#101427)" This reverts commit b45e821.
Proposed Changes
redirectToLogoutinstead oflogoutUserfor Jetpack social logins (Google, Apple, GitHub)