diff --git a/cli/agos.py b/cli/agos.py index dc6e705..fe19e41 100644 --- a/cli/agos.py +++ b/cli/agos.py @@ -229,77 +229,189 @@ _CALLBACK_SUCCESS_HTML = """ - Agos — Logged in + Agos \u2014 Signed in +
-
✓
-

You're logged in to Agos

-

Authentication successful. Return to your terminal.

- {user_block} - Open Agos → - """ @@ -309,44 +421,112 @@ _CALLBACK_ERROR_HTML = """ - Agos — Login failed + Agos \u2014 Login failed
-
✗
+
+ + + + + +

Login failed

Something went wrong during authentication.

-
{error_detail}
-

Return to your terminal and run agos login to try again.

+
{error_detail}
+

Return to your terminal and run agos login to try again.

""" @@ -369,9 +549,12 @@ def _start_callback_server(host, port, expected_state, timeout_seconds, correlat callback_payload['valid_state'] = callback_payload.get('state') == expected_state success = callback_payload['valid_state'] and not callback_payload.get('error') + _auto_close_sec = 5 if success: - user_block = '' # filled in post-token-exchange; safe placeholder - body = _CALLBACK_SUCCESS_HTML.format(user_block=user_block) + body = _CALLBACK_SUCCESS_HTML.format( + close_seconds=_auto_close_sec, + close_ms=_auto_close_sec * 1000, + ) status = 200 else: error_detail = (