Skip to content

Commit c2d845a

Browse files
jarugupjclaude
andauthored
cli: show favicon and fix title on auth success page (#187)
## Summary The browser page shown after `kernel login` (`pkg/auth/success.html`) had two issues, both visible in the tab: - **No favicon** — browsers fell back to the default globe icon. Embedded the Kernel favicon inline as an SVG data URI. Inlining (rather than serving `/favicon.ico`) avoids a race with the local callback server, which shuts down immediately after serving the page, so a follow-up request for the icon would fail. - **Garbled title** — the `<title>` used an em-dash that rendered as mojibake (`â€"`) because the page declares no charset. Swapped it for a hyphen so the tab reads `kernel cli - authenticated`. ## Test plan - [x] `go build ./...` passes - [x] Verified the embedded data URI decodes to a valid Kernel mark SVG - [x] Manual: run `kernel login`, confirm the browser tab shows the Kernel favicon and the title reads `kernel cli - authenticated` (both live in browser chrome, which headless screenshots can't capture) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Cosmetic changes to the post-login HTML only; OAuth flow and token handling are unchanged. > > **Overview** > Improves the browser tab after **`kernel login`** by fixing the success page HTML and how it is assembled in **`pkg/auth/oauth.go`**. > > Adds **`pkg/auth/favicon.svg`** and embeds it at build time. The callback handler still serves a single HTML response, but **`successHTML`** is now built from a template by substituting **`__KERNEL_FAVICON__`** with an inline **`data:image/svg+xml;base64,...`** URI so the tab icon works even though the local callback server shuts down right after the page is sent. > > Updates **`success.html`**: a **`<link rel="icon">`** uses that placeholder, and the **`<title>`** switches from an em dash (which showed as mojibake without a charset) to a plain hyphen so the tab reads **`kernel cli - authenticated`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cc3a10d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9583d23 commit c2d845a

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

pkg/auth/favicon.svg

Lines changed: 1 addition & 0 deletions
Loading

pkg/auth/oauth.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ import (
2222
)
2323

2424
//go:embed success.html
25-
var successHTML string
25+
var successHTMLTemplate string
26+
27+
//go:embed favicon.svg
28+
var faviconSVG string
29+
30+
// Inlined as a data URI because the callback server shuts down before the browser could fetch a served icon.
31+
var successHTML = strings.Replace(
32+
successHTMLTemplate,
33+
"__KERNEL_FAVICON__",
34+
"data:image/svg+xml;base64,"+base64.StdEncoding.EncodeToString([]byte(faviconSVG)),
35+
1,
36+
)
2637

2738
const (
2839
// MCP Server OAuth endpoints (which proxy to Clerk)

pkg/auth/success.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>kernel cli — authenticated</title>
4+
<title>kernel cli - authenticated</title>
5+
<link rel="icon" type="image/svg+xml" href="__KERNEL_FAVICON__">
56
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
67
<style>
78
* {

0 commit comments

Comments
 (0)