(20241204) Mail OAuth URL modified.
This commit is contained in:
@@ -136,7 +136,10 @@ async def handle_gmail_callback() -> render_template:
|
||||
# to us when the authorization was initiated. We don't mind any e-mail id being used, but we need them to be the
|
||||
# same at both ends:
|
||||
user_profile = await current_app.gmail_client.get_user_profile(tokens = tokens)
|
||||
tokens.email = user_profile.data["emailAddress"] if user_profile.success else None
|
||||
if user_profile.success:
|
||||
tokens.email = user_profile.data["emailAddress"]
|
||||
tokens.displayName = user_profile.data["displayName"]
|
||||
tokens.displayPictureUrl = user_profile.data["displayPictureUrl"]
|
||||
|
||||
# Here's where we do the checking of the e-mails,
|
||||
# if they don't match, we reject the authorization:
|
||||
|
||||
@@ -115,7 +115,7 @@ def init(blueprint_setup_state):
|
||||
# ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@mail_oauth_bp.route("/auth/oauth/url/request", methods = ["GET"])
|
||||
@mail_oauth_bp.route("/oauth", methods = ["GET"])
|
||||
@set_api_version(api_version = "1.0.0")
|
||||
@read_input(sanitize_headers = False, sanitize_data = False)
|
||||
@get_session_info(key = "X-Session-Token", session_coro = "get_session")
|
||||
|
||||
Reference in New Issue
Block a user