Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Google-scopes-handling #12362

wants to merge 5 commits into from

Conversation

guillim
Copy link
Contributor

@guillim guillim commented May 28, 2025

Summary

Enhanced the Google OAuth flow to better handle missing permissions and improved user experience by redirecting to settings/account page.

Changes

  • Added new google-apis-scopes.ts service for better scope management
  • Updated Google APIs auth controller for better flow control
  • New tests for this logic

User request

From @Bonapara email test and need to better handle user flow during the connect email flow

Before :
Screenshot 2025-05-28 at 17 58 59

After :
Screenshot 2025-05-28 at 16 29 05

Reference :

For google specialities, I added this link in the export const getGoogleApisOauthScopes in order to keep that in mind

https://developers.google.com/identity/protocols/oauth2/scopes

@guillim guillim self-assigned this May 28, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 for userinfo 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 for getGoogleScopes 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

Copy link
Contributor

github-actions bot commented May 28, 2025

🚀 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.

@guillim guillim moved this to 👀 In review in 🎯 Roadmap & Sprints May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants