feat: Update Google authorization URL with prompt for consent (#2658)

The code changes in `google_sync_routes.py` update the authorization URL
for Google authentication. The `prompt` parameter is added with the
value "consent" to ensure that users are prompted to grant consent when
authorizing the application. This improves the user experience and
ensures that the necessary permissions are obtained.

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit is contained in:
Stan Girard 2024-06-11 13:36:42 +02:00 committed by GitHub
parent 5908dfd725
commit 92ac7ae493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,10 @@ def authorize_google(
)
state = f"user_id={current_user.id}"
authorization_url, state = flow.authorization_url(
access_type="offline", include_granted_scopes="true", state=state
access_type="offline",
include_granted_scopes="true",
state=state,
prompt="consent",
)
logger.info(
f"Generated authorization URL: {authorization_url} for user: {current_user.id}"