Skip to content

feat(auth): source email brand name from branding.workspace_name setting#1450

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/brand-name-from-branding-setting
Jun 1, 2026
Merged

feat(auth): source email brand name from branding.workspace_name setting#1450
xuyushun441-sys merged 1 commit into
mainfrom
feat/brand-name-from-branding-setting

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Refs #1447 — wires the existing (but unconsumed) branding.workspace_name setting into the auth email brand name.

Problem

The Branding settings page already exposes a Workspace name field (branding.workspace_name), editable in the UI and persisted via the settings service — but nothing consumes it. Auth emails ({{appName}}) instead use a static config.appName, so renaming the product in the UI does nothing.

Change

AuthPlugin now binds the email brand name to the live setting, mirroring EmailServicePlugin's settings binding:

  • On kernel:ready (right after the email service is wired), read branding.workspace_name and push it into AuthManager.setAppName().
  • Subscribe to the branding namespace so edits apply without a redeploy.
  • Backward-compatible precedence: only an explicitly set value overrides. When the resolver returns the manifest default (source === 'default'), the override is cleared so the configured appName (e.g. a deployment's OS_APP_NAME) keeps precedence.

Resolution order: branding.workspace_name (when set) → config.appName'ObjectStack'.

The settings service is treated as optional — if it's absent, behaviour is unchanged.

Files

  • auth-manager.ts — add setAppName(name?) + appNameOverride; getAppName() now resolves override → config → default.
  • auth-plugin.tskernel:ready binding + subscribe('branding', …), guarded by try/catch.
  • auth-plugin.test.ts — 3 new tests: explicit value overrides; default source clears the override; read failure degrades gracefully. (21/21 pass.)

Out of scope (remaining #1447 checklist)

These are separate layers and not touched here:

  • apps/account/index.html <title> — Vite SPA; needs a client-side document.title update on boot.
  • packages/rest/src/rest-server.ts /docs <title> — needs the settings service threaded into RestServer.
  • Align conflicting defaults (ObjectStack vs ObjectOS Account).

Note on tenant scope

branding is scope: 'tenant', but the brand name is read globally here (no tenant ctx in email callbacks). For the single-brand control plane this is correct; per-tenant email branding would be a follow-up.

🤖 Generated with Claude Code

The `{{appName}}` brand in built-in auth emails (password reset, email
verification, org invitation, magic link) was a static config value. Wire
it to the live `branding.workspace_name` setting so admins can rename the
product from the Branding settings UI without a redeploy.

AuthPlugin binds on `kernel:ready` and re-applies on `settings:changed`,
mirroring EmailServicePlugin's settings binding. Only an *explicitly set*
value overrides the configured `appName` — when the resolver returns the
manifest default, AuthManager keeps the configured `appName` (e.g. the
deployment's OS_APP_NAME), preserving backward compatibility.

Resolution order: branding.workspace_name (when set) > config.appName > 'ObjectStack'.

Refs #1447.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 5:57am

Request Review

@xuyushun441-sys xuyushun441-sys merged commit ef55fc1 into main Jun 1, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/brand-name-from-branding-setting branch June 1, 2026 06:58
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