feat(auth): source email brand name from branding.workspace_name setting#1450
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1447 — wires the existing (but unconsumed)
branding.workspace_namesetting 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 staticconfig.appName, so renaming the product in the UI does nothing.Change
AuthPluginnow binds the email brand name to the live setting, mirroringEmailServicePlugin's settings binding:kernel:ready(right after the email service is wired), readbranding.workspace_nameand push it intoAuthManager.setAppName().brandingnamespace so edits apply without a redeploy.source === 'default'), the override is cleared so the configuredappName(e.g. a deployment'sOS_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— addsetAppName(name?)+appNameOverride;getAppName()now resolves override → config → default.auth-plugin.ts—kernel:readybinding +subscribe('branding', …), guarded by try/catch.auth-plugin.test.ts— 3 new tests: explicit value overrides;defaultsource 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-sidedocument.titleupdate on boot.packages/rest/src/rest-server.ts/docs<title>— needs the settings service threaded intoRestServer.ObjectStackvsObjectOS Account).Note on tenant scope
brandingisscope: '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