(20241203) Solutions didn'r work. Reverting.
This commit is contained in:
@@ -117,7 +117,7 @@ async def handle_gmail_callback() -> render_template:
|
||||
tokens_saved = False
|
||||
|
||||
# In case the user cancelled halfway through (on Google's screen):
|
||||
if g.inbound_data.get("error") == "access_denied": return render_template(
|
||||
if g.inbound_data.get("error") == "access_denied": return await render_template(
|
||||
"/mail/oauth/oauth_cancelled_v2.html",
|
||||
mail_client = g.mail_client.title()
|
||||
)
|
||||
@@ -147,7 +147,7 @@ async def handle_gmail_callback() -> render_template:
|
||||
if (
|
||||
(not placeholder_token) or
|
||||
placeholder_token["clientUserId"]["email"] != str(tokens.email)
|
||||
): return render_template(
|
||||
): return await render_template(
|
||||
"/mail/oauth/oauth_failure_v2.html",
|
||||
mail_client = g.mail_client.title(),
|
||||
failure_hint = f"We were expecting authorization from '{placeholder_token['clientUserId']['email']}' but got authorization from '{tokens.email}' instead."
|
||||
@@ -199,13 +199,13 @@ async def handle_gmail_callback() -> render_template:
|
||||
)
|
||||
|
||||
# Return an HTML response for success:
|
||||
if tokens_saved: await render_template(
|
||||
if tokens_saved: return await render_template(
|
||||
"/mail/oauth/oauth_success_v2.html",
|
||||
mail_client = g.mail_client.title()
|
||||
)
|
||||
|
||||
# Return an HTML response for failure:
|
||||
else: return render_template(
|
||||
else: return await render_template(
|
||||
"/mail/oauth/oauth_failure_v2.html",
|
||||
mail_client = g.mail_client.title(),
|
||||
failure_hint = f"Unknown error. Please use log-id '{g.log_id}' to check with the support team."
|
||||
@@ -262,9 +262,7 @@ async def mail_callback(
|
||||
# ┣┫┏┓┏┓┏┫┃┏┓ ┃ ┏┓┃┃┣┓┏┓┏┃┏┏
|
||||
# ┛┗┗┻┛┗┗┻┗┗ ┗┛┗┻┗┗┗┛┗┻┗┛┗┛
|
||||
|
||||
if mail_client == "gmail":
|
||||
template = await handle_gmail_callback()
|
||||
return await template
|
||||
if mail_client == "gmail": return await handle_gmail_callback()
|
||||
|
||||
# ┓┏ ┓┓ ┳ ┓• ┓ ┏┓┓•
|
||||
# ┣┫┏┓┏┓┏┫┃┏┓ ┃┏┓┓┏┏┓┃┓┏┫ ┃ ┃┓┏┓┏┓╋
|
||||
|
||||
Reference in New Issue
Block a user