Skip to main content

Company Branding Logo (Live from BCYIP)

Version: 3.0.0 Date: 2026-05-07

Goal: White-label logo on login and sidebar, always reflecting the live company.customization.logo from BCYIP — no stale copy in activation.token.

Solution: Public GET /api/v1/branding endpoint calls BCYIP /user, normalises the logo to a data URL, and returns it. UI caches for 3 minutes and refreshes on window focus.

Features:

  • Public GET /api/v1/branding (no Tower JWT required)
  • Logo follows BCYIP admin changes after cache TTL or window focus
  • Falls back to default SVG on any failure or missing logo

Implementation Details:

  • company-logo.ts normalises Mongoose buffer JSON and various logo encodings
  • React Query staleTime: 3 minutes, refetchOnWindowFocus: true
  • tower.api uses a local session key string to avoid circular import with login.tsx

Files Modified:

  • src/protocol/bcyip/company-logo.ts, src/protocol/bcyip/company-logo.spec.ts - Logo normalisation
  • src/protocol/bcyip/api.ts - fetchCompanyBranding
  • src/core/data/data.service.ts - Branding integration
  • src/app.controller.ts - Public branding endpoint
  • ui/src/protocol/branding.api.ts - Axios call (no session)
  • ui/src/components/atoms/BrandingLogo.tsx - React component
  • ui/src/components/layout/Sidenav.tsx - Logo in sidebar
  • ui/src/pages/login/login.tsx - Logo on login screen
  • package.json, package-lock.json, ui/package.json, ui/package-lock.json - Snyk fixes (uuid@11.1.1, axios@^1.15.2, overrides for follow-redirects/immutable/picomatch/yaml)