(20241129) HTML views adjusted.

This commit is contained in:
2024-11-29 14:34:35 +05:30
parent f9a517f6a7
commit e94271e45a
4 changed files with 348 additions and 1 deletions
+7 -1
View File
@@ -150,6 +150,12 @@ async def mail_callback(
if mail_client == "gmail":
# In case the user cancelled halfway through (on Google's screen):
if inbound_data.get("error") == "access_denied": return await render_template(
"/mail/oauth/oauth_cancelled_v2.html",
mail_client = mail_client.title()
)
# Generate the tokens from the callback:
tokens = await current_app.gmail_client.get_authorization_tokens(
redirect_url = request.url,
@@ -188,7 +194,7 @@ async def mail_callback(
# Return an HTML response:
return await render_template(
"/mail/oauth/oauth_success.html" if tokens_saved else "/mail/oauth/oauth_failure.html",
"/mail/oauth/oauth_success_v2.html" if tokens_saved else "/mail/oauth/oauth_failure_v2.html",
mail_client = mail_client.title()
)