From fc49bd57727575fe6f23b3006587670e91c533c6 Mon Sep 17 00:00:00 2001 From: khushal Date: Wed, 4 Dec 2024 16:52:12 +0530 Subject: [PATCH] (20241204) Trying to solve Gmail's scopes --- api/blueprints/mail/oauth_callback.py | 2 +- utils_v2/goog/gmail/gmail_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/blueprints/mail/oauth_callback.py b/api/blueprints/mail/oauth_callback.py index 85ed382..76bda6a 100644 --- a/api/blueprints/mail/oauth_callback.py +++ b/api/blueprints/mail/oauth_callback.py @@ -140,7 +140,7 @@ async def handle_gmail_callback() -> render_template: # achieved by 'request.url' like this: tokens = await current_app.gmail_client.get_authorization_tokens( redirect_url = request.url, - scopes = g.inbound_data["scope"] + scopes = g.inbound_data["scope"].split(" ") ) if tokens: diff --git a/utils_v2/goog/gmail/gmail_client.py b/utils_v2/goog/gmail/gmail_client.py index f45b825..7a22a1b 100644 --- a/utils_v2/goog/gmail/gmail_client.py +++ b/utils_v2/goog/gmail/gmail_client.py @@ -92,12 +92,12 @@ import base64 SCOPES_GMAIL_MAIL_MANAGEMENT = [ r"https://www.googleapis.com/auth/gmail.modify", r"https://www.googleapis.com/auth/gmail.labels", - r"profile", + # r"profile", r"https://www.googleapis.com/auth/userinfo.profile" ] SCOPES_GMAIL_FULL = [ r"https://mail.google.com/", - r"profile", + # r"profile", r"https://www.googleapis.com/auth/userinfo.profile" ]