From 31e27b76b634d18dbb3f6a0aefa14e54fff8b74d Mon Sep 17 00:00:00 2001 From: seidnerj <4147381+seidnerj@users.noreply.github.com> Date: Sat, 14 Mar 2026 01:36:34 +0200 Subject: [PATCH] fix: improve OAuth response pages for browser compatibility window.close() is blocked by modern browsers for tabs not opened via window.open(). The success page's close button and auto-close timer silently fail as a result. - Add tryClose() that attempts window.close() and falls back to showing "You can close this tab manually" after 500ms - Remove ineffective auto-close scripts from error pages --- auth/oauth_responses.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/auth/oauth_responses.py b/auth/oauth_responses.py index ee31b6e..ef79ef6 100644 --- a/auth/oauth_responses.py +++ b/auth/oauth_responses.py @@ -26,8 +26,7 @@ def create_error_response(error_message: str, status_code: int = 400) -> HTMLRes

Authentication Error

{error_message}

-

Please ensure you grant the requested permissions. You can close this window and try again.

- +

Please ensure you grant the requested permissions. You can close this tab and try again.

""" @@ -176,9 +175,17 @@ def create_success_response(verified_user_id: Optional[str] = None) -> HTMLRespo }} @@ -191,7 +198,7 @@ def create_success_response(verified_user_id: Optional[str] = None) -> HTMLRespo
Your credentials have been securely saved. You can now close this window and retry your original command.
- +
This window will close automatically in 10 seconds
@@ -215,8 +222,7 @@ def create_server_error_response(error_detail: str) -> HTMLResponse:

Authentication Processing Error

An unexpected error occurred while processing your authentication: {error_detail}

-

Please try again. You can close this window.

- +

Please try again. You can close this tab.

"""