feat(auth): styled success page for the OAuth browser callback#868
feat(auth): styled success page for the OAuth browser callback#868greatcoat wants to merge 1 commit into
Conversation
Replaces the bare '<h1>Success!</h1>' callback response with a small self-contained page: green check, 'You're signed in', and a terminal-style echo pointing the user back to the CLI. No JavaScript, no external requests; honors prefers-color-scheme and prefers-reduced-motion; adds charset and Connection: close headers. ~2.5 KB embedded as a raw-string const. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience during the OAuth authentication flow by replacing the bare-bones success message with a modern, responsive, and accessible HTML page. The change maintains the existing lightweight delivery mechanism while providing clearer feedback to the user, including a terminal-like confirmation that guides them back to the CLI. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request replaces the basic HTML success page shown after a successful OAuth callback with a polished, self-contained HTML page that supports light/dark modes and reduced-motion settings. The reviewer suggests adding a Content-Length header to the HTTP response to prevent the browser from showing a spinning loading indicator while the subsequent token exchange is being processed.
| let response = format!( | ||
| "HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nConnection: close\r\n\r\n{AUTH_SUCCESS_PAGE}" | ||
| ); |
There was a problem hiding this comment.
Without a Content-Length header, the browser does not know when the HTTP response has ended because the connection remains open during the subsequent exchange_code_with_reqwest network call (even though Connection: close is specified). This causes the browser tab to show a spinning loading indicator and potentially delay rendering or complete page load until the token exchange finishes and the stream is dropped.
Adding a Content-Length header with the exact byte length of the HTML body allows the browser to immediately finish loading and render the polished success page instantly.
let response = format!(
"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{AUTH_SUCCESS_PAGE}",
AUTH_SUCCESS_PAGE.len()
);
What
Replaces the OAuth callback's bare
<h1>Success!</h1>response with a small, self-contained success page.Before: unstyled default-font HTML — reads as broken/unfinished right after Google's polished consent screen.
After: a centered card with a green check, "You're signed in", and a terminal-style echo (
$ gws auth login→✓ authentication successful — credentials saved) that points the user back to the terminal — where gws lives.Properties
const, served exactly like before (onewrite_all).prefers-color-scheme(Material greens:#188038/#81c995).prefers-reduced-motion(the only animation is a 240 ms check pop-in),lang,role="status", decorative icon isaria-hidden.charset=utf-8andConnection: closeto the response headers.Verified rendering in Chrome in both color schemes.
🤖 Generated with Claude Code