-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Google-scopes-handling #12362
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
base: main
Are you sure you want to change the base?
Google-scopes-handling #12362
Conversation
…tion to settings/account
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.
PR Summary
This PR enhances Google OAuth flow with improved scope management and error handling. The changes introduce a new GoogleAPIScopesService
for validating OAuth permissions and better user experience.
- Added new
GoogleAPIScopesService
with proper validation for Google OAuth scopes and fallback handling foruserinfo
prefixes - Updated error redirect path from '/verify' to '/settings/accounts' in
google-apis-auth.controller.ts
for better UX - Added 600ms timeout for token info requests in
google-apis-scopes.ts
which might be too short for some network conditions - Added comprehensive test coverage in
google-apis-scopes.spec.ts
but missing tests forgetGoogleScopes
method - Added documentation for special handling of 'email', 'profile', and 'openid' permissions without the full Google API prefix
7 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-server/src/engine/core-modules/auth/services/google-apis-scopes.spec.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/auth/services/google-apis-scopes.spec.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/auth/services/google-apis-scopes.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/auth/services/google-apis.service.spec.ts
Outdated
Show resolved
Hide resolved
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:53532 This environment will automatically shut down when the PR is closed or after 5 hours. |
Summary
Enhanced the Google OAuth flow to better handle missing permissions and improved user experience by redirecting to settings/account page.
Changes
User request
From @Bonapara email test and need to better handle user flow during the connect email flow
Before :

After :

Reference :
For google specialities, I added this link in the
export const getGoogleApisOauthScopes
in order to keep that in mindhttps://developers.google.com/identity/protocols/oauth2/scopes