Sign-in look: the client's logo or the site's name on a dark panel beside the form (whiteLabel.signIn)

On by default with whiteLabel. The login screen and the 2FA screens get the look through AdminLogo and
SafeTotpView, which every site already has in its import map: an upgrade needs no edit. allScreens adds one
provider (SignInLook) for forgot / reset password, first user and logout; a production start leaves it out
when the import map on disk lacks it. Logo and name come from Site settings: no new field, no migration.
Language links through GET /api/ipal/admin-language (Payload's own cookie, back to an admin path only).
Options: accent, logoMadeFor, languages, svgLogo; whiteLabel.brandAccess 'admin'. The 2FA code boxes get
names for screen readers. Reference site and starter: allScreens on. Docs, agent guide, skills, tests.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-26 20:35:33 +01:00
co-authored by Claude Fable 5.2
parent e821d52d19
commit b6c91a3a11
38 changed files with 1792 additions and 21 deletions
+18
View File
@@ -1,5 +1,7 @@
import type { CollectionSlug, Field, PayloadComponent, PayloadRequest, Plugin } from 'payload'
import type { SignInLookOptions } from './modules/branding/signIn/options.js'
/**
* Factory shape of @clocklimited/payload-2fa's `payloadTotp` export — injected
* so the plugin never imports the optional peer itself. `collection` is
@@ -443,6 +445,12 @@ export type IaplOptions = {
*/
whiteLabel?:
| {
/**
* Who may change the brand the sign-in screens show (the name, logo and
* icon fields of Site settings). Default `'editor'`: whoever may edit Site
* settings, as before. `'admin'`: field-level access, admins only.
*/
brandAccess?: 'admin' | 'editor'
/**
* Vendor credit ("Technology support: Intecion.com") at the bottom of the
* admin nav. Default on; `false` hides it, or override text/url.
@@ -469,6 +477,16 @@ export type IaplOptions = {
nameField?: string
/** SiteSettings global slug. Default 'site-settings'. */
settingsSlug?: string
/**
* The look of the panel's sign-in screens: a dark panel with the client's
* logo (or the site's name) beside the form, in both themes and on a phone.
* On by default with `whiteLabel`: the login screen and the 2FA screens get
* it through components every white-label site already has in its import
* map. `{ allScreens: true }` adds one provider (one new import-map entry)
* and covers forgot / reset password, create first user and logout too.
* `false` keeps Payload's own screens. See docs/white-label.md.
*/
signIn?: boolean | SignInLookOptions
/** Static browser-tab title suffix (e.g. ' · Acme Admin'). */
titleSuffix?: string
}