Skip to content

feat(auth): styled success page for the OAuth browser callback#868

Open
greatcoat wants to merge 1 commit into
googleworkspace:mainfrom
greatcoat:improve-oauth-success-page
Open

feat(auth): styled success page for the OAuth browser callback#868
greatcoat wants to merge 1 commit into
googleworkspace:mainfrom
greatcoat:improve-oauth-success-page

Conversation

@greatcoat

Copy link
Copy Markdown

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

  • No JavaScript, no external requests — a single ~2.5 KB HTML string embedded as a raw-string const, served exactly like before (one write_all).
  • Light/dark aware via prefers-color-scheme (Material greens: #188038 / #81c995).
  • Accessible: honors prefers-reduced-motion (the only animation is a 240 ms check pop-in), lang, role="status", decorative icon is aria-hidden.
  • Adds charset=utf-8 and Connection: close to the response headers.
  • No control-flow changes — only the response body/headers.

Verified rendering in Chrome in both color schemes.

🤖 Generated with Claude Code

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>
@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ccaf7cb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Improved OAuth Callback UI: Replaced the minimal, unstyled 'Success!' message with a polished, self-contained HTML page featuring a centered card and a terminal-style success indicator.
  • Accessibility and Theming: The new page supports light/dark mode via system preferences, respects reduced-motion settings, and includes appropriate ARIA roles for better accessibility.
  • Zero-Dependency Design: The implementation uses a single embedded HTML string with no external assets or JavaScript, ensuring a lightweight and secure response.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla

google-cla Bot commented Jul 5, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +215 to +217
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}"
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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()
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants