From 6b7cdbf82ce76ef0f585aea63c63e518d863e0e0 Mon Sep 17 00:00:00 2001 From: Rajat Saxena Date: Mon, 2 Nov 2026 23:48:40 +0530 Subject: [PATCH] feat(auth): brand hosted login with FrontLit identity - Add the FrontLit logo, favicon, and primary color to hosted login - Cover the branding in OAuth page tests --- apps/api/src/auth/oauth-pages.test.ts | 7 +++++++ apps/api/src/auth/oauth-pages.ts | 3 +++ 2 files changed, 10 insertions(+) diff --git a/apps/api/src/auth/oauth-pages.test.ts b/apps/api/src/auth/oauth-pages.test.ts index b40dd54..38fcbb8 100644 --- a/apps/api/src/auth/oauth-pages.test.ts +++ b/apps/api/src/auth/oauth-pages.test.ts @@ -63,6 +63,13 @@ describe("FrontLit OAuth pages", () => { expect(response.headers.get("x-frame-options")).toBe("DENY"); }); + it("brands the hosted login with the FrontLit logo, favicon, and color", async () => { + const response = await request("/login?redirect=http://localhost:3000/pages/foo"); + expect(response.body).toContain('src="http://localhost:3000/icon.svg"'); + expect(response.body).toContain('href="http://localhost:3000/icon.svg"'); + expect(response.body).toContain("html{--brand-primary:oklch(0.47 0.14 230)}"); + }); + it("no longer serves an OAuth team picker", async () => { const response = await request("/oauth/select-team?client_id=abc"); expect(response.status).toBe(404); diff --git a/apps/api/src/auth/oauth-pages.ts b/apps/api/src/auth/oauth-pages.ts index 7c7cf4a..23abda9 100644 --- a/apps/api/src/auth/oauth-pages.ts +++ b/apps/api/src/auth/oauth-pages.ts @@ -10,6 +10,9 @@ router.use( authBasePath, allowedRedirectOrigins: [webClientUrl], defaultRedirectUrl: new URL("/", webClientUrl).toString(), + logoUrl: new URL("/icon.svg", webClientUrl).toString(), + faviconUrl: new URL("/icon.svg", webClientUrl).toString(), + primaryColor: "oklch(0.47 0.14 230)", loginMethods: hostedLoginMethods, legacyHostOnlySessionCookieNames: process.env.AUTH_COOKIE_DOMAIN ? [