Merge claude/login-page-whitelabel-616f3d: the panel's sign-in look (whiteLabel.signIn), the client's logo, hardened brand image fetch

Conflicts kept both sides: the 2FA texts (twoFactorBusy from A, twoFactorCodeDigit here), the reference index rows,
and the e2e:built line (closed doors from C and the sign-in look here). routes.snapshot.json judges the new public
GET /api/ipal/admin-language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-26 22:04:30 +01:00
co-authored by Claude Opus 5.5
126 changed files with 2283 additions and 46 deletions
+78
View File
@@ -0,0 +1,78 @@
# The panel's sign-in screens: design notes and screenshots
Design record of `whiteLabel.signIn` (the user-facing page is [white-label.md](../../white-label.md) → "The sign-in
screens"). The goal: IAPL's sign-in looks like IAWL's (the WordPress sibling), and both have a place for the client's
logo.
## Files here
Made with `node scripts/login-page-shots.mjs` (headless Chromium, 1280 × 800 and 390 × 844) against the reference
site; `after-*` from a production build with `signIn: { allScreens: true }`, `before-*` from main (1.17.0).
| Files | What |
|---|---|
| `before-*.png` | IAPL 1.17.0: login (light, dark, phone, Polish, wrong password), forgot password, 2FA code, 2FA setup; `-logo` = with a logo set |
| `after-*-name.png` | the new look with no logo set: the site's name |
| `after-*-logo.png` | the new look with a logo made for dark grounds (`placeholder-logo-for-dark.png`), no plate — the default |
| `after-login-*-logo-dark-letters-no-plate.png` | a logo with dark letters (`placeholder-logo.png`) on the default: hard to read; such a site sets `logoPlate: true` |
| `after-first-user-*.png` | create first user on an empty database (no site name yet: the host is shown) |
| `legacy-unedited-*.png` | the reference site as it was at v1.16.7, **unedited**, built against this plugin: login has the look (through `AdminLogo`), forgot password and create first user are Payload's own until the project sets `allScreens` |
| `iawl-*.png` | IAWL's sign-in page, copied from its repository (`docs/reviews/white-label/`, made 2026-11-24; the languages are still a drop-down there). `iawl-current-sign-in.png` is the page as built now (`docs/reviews/rule-13/after-5-sign-in.png`) |
| `placeholder-logo*.png` | the placeholder logos (dark text; white text for `logoMadeFor: 'dark'`) |
Screens: `login-{light,dark,phone,phone-dark,pl}`, `login-error-{light,phone}`, `forgot-{light,dark,phone}`,
`2fa-code-{light,dark,phone}`, `2fa-setup-{light,dark,phone}`, `first-user-{light,dark,phone}` (needs a database
without users: `--only=first-user`). The files are 8-bit PNGs (re-encoded to keep the folder small).
## What defines IAWL's sign-in page (read from `plugin/assets/sign-in/sign-in.css`, `SignInLook.php`, `Logo.php`, `LanguageSwitcher.php`)
- **Layout:** two columns, 5 : 6. Left: a dark panel (`#060606`) inset 10 px from the window's edge, 20 px corners,
a faint grid (3.5 × 2.5 rem cells, 4 % white lines) and two blue glows (`rgb(0 158 246)`, 22–24 %). Right: a white
page with the form, 28 rem wide, centred in its column. No card around the form.
- **On the panel**, at the bottom: a label "ADMINISTRATION PANEL" (mono, 14 px, 600, upper case, 0.05 em tracking,
`#b2b2b2`, a 5 px blue square before it), then the logo on a white plate (12 px corners, 16 × 20 px padding; the
logo fits 240 × 72) or the site's name as text (weight 500, −0.03 em, clamp 36–60 px). Both link to the site.
- **Form:** labels above fields, 48 px fields with a 1 px `#80868f` border and 6 px corners, a full-width 50 px blue
button (`#0070c0`, hover `#005a9e`, white text), links `#006bb8` underlined, focus ring 2 px `#017bd0`.
- **Under the form:** links (lost password, back to the site), the languages as links, a hairline, and the credit
"Technology support: Intecion.com" (13 px, muted, centred).
- **Messages:** boxes above the form with a 4 px bar on the leading edge: red for errors, green for success.
- **Phone (≤ 52 rem):** the panel is a band above the form, bottom corners rounded, the logo 192 × 56.
- **Theme:** none: the panel is always dark, the form always light. **Fonts:** Outfit / Inter / Roboto Mono from
local files, part of the credit (off with `credit => false`). **Script:** one optional file, the grid light that
follows the mouse.
- **States:** WordPress's own (errors, lost password, reset with the strength meter, logged out, interim frame);
IAWL changes the look only.
## How IAPL maps it
| Element | IAPL | Same as IAWL? |
|---|---|---|
| Split, panel inset and corners, grid, glows, colours | the same numbers (`css.ts`) | yes |
| Label, logo box (240 × 72, 2× source), name as text, link to the site, alternative text | the same | yes |
| Logo types (JPEG, PNG, WebP, AVIF, GIF; no SVG) and the look at the file before printing | the same; Payload accepts SVG uploads, so `svgLogo: true` exists; the file is checked by a fetch (IAWL reads the disk), and an unreachable address counts as "believe the upload" | yes, two notes |
| Plate | **no plate by default** (the owner's choice for new surfaces), `logoPlate: true` adds it | IAWL: plate by default, `logoMadeFor => 'dark'` removes it |
| Button, link, focus and border colours; field and button heights; 28 rem column | the same | yes |
| Phone band at 52 rem | the same | yes |
| Languages | links, **on the panel** (top corner; under the brand on a phone), because the form's markup is Payload's and differs per screen | place differs |
| Credit line | under the login form, hairline above (login only, as before) | IAWL: every screen |
| Dark theme | the form's side follows the admin theme; the panel stays dark | IAWL has no dark form |
| Fonts | the admin's own font stack and the system's mono; no font file | differs (no extra request before sign-in) |
| Grid light (script) | not built: no script on the sign-in page | differs |
| Messages | Payload's own toasts and field errors, unchanged | differs |
| Field look | Payload's fields with the shared border colour and height | close |
## Decisions
1. **Carried by components every site already has.** A new admin component needs a new import-map entry, and a
provider missing from the map blanks the whole panel. So `AdminLogo` prints the panel on the login screen and
`SafeTotpView` in front of the 2FA screens; only `allScreens` adds a provider (`SignInLook`), guarded at start.
2. **The panel is one self-contained element**, fixed on a desktop and in the flow on a phone, hidden by its own
CSS off the minimal template. It therefore works wherever it is printed (inside the login form's wrapper, before
a 2FA view, at the top of the body).
3. **No new stored data.** Logo and name are Site settings fields that exist since 1.0 — the ones the public site
reads — so every part of the site shows the same logo and there is no migration. The plate switch (`logoPlate`)
and the accent are code options; putting them in the panel would add columns on SQL.
4. **Payload draws its admin screens in the browser** (the server's HTML body is empty until React runs), so "no
flash" means: the panel, its stylesheet and the form appear in the same step. The e2e spec checks that the
form's template is never in the page without them.
Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

+70
View File
@@ -0,0 +1,70 @@
# Changelog draft — the sign-in look (for 1.17.1)
To be placed in `docs/CHANGELOG.md` by the release; the version number is the integration session's call.
## Read before upgrading
**The panel's sign-in page looks different on every site with `whiteLabel`.** After the update the login screen and
the 2FA screens (code, setup) show a dark panel with the client's logo — or the site's name — beside the form, the
look IAPL now shares with IAWL. No edit, no `generate:importmap`, no migration, no new env var.
Keep Payload's screens: `whiteLabel: { signIn: false }`. Sites without `whiteLabel`: nothing changes.
Three things to look at on such a site, each with a one-line way back:
- **The logo stands straight on a dark panel** (no plate). A logo with dark letters: `signIn: { logoPlate: true }`.
- **An SVG logo is not shown on the sign-in screens** (the site's name is; the rest of the site is untouched):
upload a PNG / WebP logo or set `signIn: { svgLogo: true }`.
- **Editors can no longer change the site's name, logo and icon** in Site settings (admins can): these are what the
public sign-in page shows. `whiteLabel: { brandAccess: 'editor' }` gives them back.
## Security
- **The public preview-image endpoint could be made to fetch from a host named in the request.**
`GET /api/ipal/admin-og` resolved a site-relative logo address against the request's own host and fetched it with
redirects followed, no timeout and no size limit; `GET /api/ipal/admin-icon` resolved the same way. Both now
resolve against the site's configured origin only (`serverURL`, else `NEXT_PUBLIC_SERVER_URL`), ask one address,
never follow a redirect, give up after 5 s and stop reading at 512 KB. `fetchPublicImage` (exported) behaves so
for every caller and takes `{ timeoutMs }`; new export `PUBLIC_IMAGE_TIMEOUT_MS`. **For a project:** nothing to do
when `serverURL` is set (the starter sets it). A site without `serverURL` and without `NEXT_PUBLIC_SERVER_URL`
loses the logo in its panel link preview (the site name is drawn) and the icon endpoint redirects to the media
file — set `serverURL`. A logo or icon whose address answers with a redirect is no longer fetched by the server.
## Added
- **Sign-in look (`whiteLabel.signIn`, on with `whiteLabel`).** A dark panel with the label "Administration panel",
the client's logo (Site settings → Logo) or the site's name, and the panel's languages as links;
the form beside it, in both admin themes; a band above the form on a phone. Logo and name come from Site settings:
no env var, **no new field, no schema change** (MongoDB, Postgres, SQLite alike). With nothing set the panel shows
the label and the site's host — no Payload or Intecion mark. The logo on a white plate is an option; the default is no plate.
- **`signIn: { allScreens: true }`** — the same look on forgot / reset password, create first user, logout and
"unauthorized". Adds the provider `SignInLook` (one import-map entry: `pnpm payload generate:importmap`). The
project starter writes it for new sites. A production start that does not find the entry in `importMap.js`
leaves the provider out and logs what to run; the panel keeps working.
- **The logo follows IAWL's rules:** JPEG, PNG, WebP, AVIF or GIF; fetched and checked by its bytes before it is
printed (at most 512 KB; a deleted or broken file gives the name); fits 240 × 72, served from a generated size
at least twice as wide when the media collection has one; alternative text = the site's name.
- **Options:** `signIn.accent` (hex colour of the button, links and focus ring), `signIn.logoPlate` (a white plate),
`signIn.svgLogo` (allow an SVG logo), `signIn.checkLogo: false`, `signIn.languages: false`,
`whiteLabel.brandAccess` (`'admin'` with the look, `'editor'` as before; field-level access, no schema change).
CSS variables `--iapl-signin-*` for a project's `custom.scss`.
- **Language links before sign-in:** `GET /api/ipal/admin-language?lng=<code>` writes Payload's language cookie for
a supported language and returns to the admin page it was opened from (public; 400 for an unknown language;
never redirects off the admin route). Registered only with the sign-in look and `languages !== false`.
- **The 2FA code boxes have names** for screen readers ("Digit 2 of 6") and ask a phone for the numeric keyboard
(with the sign-in look).
- Exports: `SignInPanel`, `SignInLook` (`/admin`); `resolveSignInLook`, `loadSignInBrand`, `signInLogo`,
`signInName`, `checkLogoFile`, `fitLogo`, `isSvgUpload`, `SIGN_IN_LOGO_TYPES`, `languageLinks`, `LANGUAGE_NAMES`, `signInCss`, `isHexColour`,
`signInProviderActive`, `buildAdminLanguageEndpoint`, `adminPathFromReferer`, `SIGN_IN_LOOK`, `SIGN_IN_STYLE_ID`,
`SIGN_IN_LOGO_BOX`, `SIGN_IN_NAME_MAX`, `ADMIN_LANGUAGE_PATH` and their types.
## Changed
- `AdminLogo` prints the sign-in panel when the plugin gives it `signIn` (the default with `whiteLabel`); wired by
hand without that prop it is the plain logo as before. The logo on the login screen is now shown inside
240 × 72 px (it was up to 420 × 120).
- The credit line under the login form: full-strength muted colour and a hairline above it (it was 60 % opacity).
- The reference site and the starter use `whiteLabel: { signIn: { allScreens: true } }`.
## Requires project changes
None for the panel to work — but read the three points at the top. Recommended: `allScreens` (one config line, regenerate the import map). A project with its own CSS for the
login screen looks at the result after the update.
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB