Commit a1075a5c authored by Timo Furrer's avatar Timo Furrer
Browse files

Merge branch 'tv/2026-02/cli-oauth-confirmation' into 'main'

chore(oauth): improve the look of the OAuth confirmation page

See merge request !2739
parents a505b089 6a8eac0e
Loading
Loading
Loading
Loading
Loading
+41 −9
Original line number Diff line number Diff line
@@ -230,15 +230,47 @@ func (s *CallbackServer) callbackHandler(ctx context.Context, tokenChan chan *oa

		// Send success response
		tokenChan <- token
		w.Header().Set("Content-Type", "text/html")
		_, _ = w.Write([]byte(`
            <html>
            <body style="text-align: center; padding: 50px;">
                <h1 style="color: green;">Authentication Successful!</h1>
		w.Header().Set("Content-Type", "text/html; charset=utf-8")
		_, _ = w.Write([]byte(`<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Authentication Successful</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            margin: 0;
            background: #fafafa;
        }
        .container {
            text-align: center;
            padding: 2rem;
        }
        h1 {
            color: #108548;
            font-size: 1.5rem;
            font-weight: 600;
            margin: 0 0 0.5rem 0;
        }
        p {
            color: #666;
            margin: 0;
            line-height: 1.5;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>✓ Authentication Successful!</h1>
        <p>You can close this window and return to the application.</p>
    </div>
</body>
            </html>
        `))
</html>`))
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ func TestCallbackServer_CallbackHandler(t *testing.T) { //nolint:paralleltest
		// Check HTTP response
		assert.Equal(t, http.StatusOK, w.Code)
		assert.Contains(t, w.Body.String(), "Authentication Successful!")
		assert.Equal(t, "text/html", w.Header().Get("Content-Type"))
		assert.Equal(t, "text/html; charset=utf-8", w.Header().Get("Content-Type"))
	})

	t.Run("callback with invalid state", func(t *testing.T) { //nolint:paralleltest