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]>
@@ -1171,6 +1171,7 @@ project → **plugin gap**, not a copy.
|
||||
| Mail | `email: mailAdapter()` + `serverURL` — mail works with no other setup, through the Intecion mail service; SMTP in the panel only when the client asks; your own mail: `payload.sendEmail` (`withMailKind` when it is account mail); never a second transport in the project. §7.2 | email.md |
|
||||
| Env validation, health | `assertEnv(iaplEnvRules({…}))` (`/env`), `healthRoute` | env.md |
|
||||
| 2FA, white-label, headers | `twoFactor: { issuer, plugin: payloadTotp }`, `whiteLabel`, `buildSecurityHeaders` | security.md, white-label.md |
|
||||
| Sign-in screens (login, forgot / reset password, first user, logout, the 2FA screens): a dark panel with the client's logo or the site's name beside the form, language links, both themes, phone | on with `whiteLabel` (`signIn`); a NEW site: `whiteLabel: { signIn: { allScreens: true } }` + `pnpm payload generate:importmap` (adds the provider `SignInLook`; without it only login and the 2FA screens get the look, through `AdminLogo` / `SafeTotpView`). Logo and name come from Site settings (no env var, no new field, no migration). The logo is a bitmap (JPEG, PNG, WebP, AVIF, GIF; an SVG logo shows the name unless `svgLogo: true`), checked by its bytes before it is printed (`checkLogo`), without a plate (`logoPlate: true` for a logo with dark letters). Options: `accent` (hex), `languages: false`; `signIn: false` = Payload's screens. Name / logo / icon are admin-only with the look (`brandAccess: 'editor'` = as before). Never build a login page, a custom `graphics.Logo` or login CSS by hand. Check: `curl -s $URL/admin/login \| grep -c iapl-signin__label` ≥ 1; `curl -si "$URL/api/ipal/admin-language?lng=xx"` → 400 | white-label.md → "The sign-in screens" |
|
||||
| Panel link preview + noindex (site name, description, preview image, technology support credit) | on by default (`adminMeta`, `agency`) — do not hand-write `admin.meta` for it; override single keys in `admin.meta` or `adminMeta: { … }` | white-label.md |
|
||||
| Rate limit (forms, MCP, search) | built in; IP from `IAPL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md |
|
||||
|
||||
|
||||
@@ -1175,6 +1175,7 @@ Rules: AGENT.md §8a.
|
||||
| `e2e/mail-relay.spec.ts` | the mail service on a built site: the state block in the panel, the first e-mail through the public confirm route, no token in anything the browser receives |
|
||||
| `e2e/routes.snapshot.json` | every public route of the site (REST, GraphQL, Next route files) with one line saying who may use it and why — the judged list `routes:check` compares with |
|
||||
| `e2e/routes.ts` | `routes:check`: the site's public routes against e2e/routes.snapshot.json (`pnpm payload run e2e/routes.ts [update]`; from the repository `pnpm routes:check`) (below) |
|
||||
| `e2e/sign-in-look.spec.ts` | browser test of the sign-in look (whiteLabel.signIn): the panel comes with the form, sits above it on a phone in both themes, is on forgot / reset / logout too, the language links work, the 2FA code screen keeps its boxes (now named) |
|
||||
| `e2e/smoke.spec.ts` | the smoke tests every release must pass: pages, showcase, forms (also a file sent by e-mail), sitemap, SEO/GEO, headers, consent, 2FA |
|
||||
| `e2e/smtp-sink.ts` | a local mail sink for the smoke tests: reads what the site really sent (recipients, attachments) |
|
||||
| `e2e/totp.ts` | RFC 6238 code generator for the 2FA sign-in in the smoke test, and the addresses of the second test admin and the test editor (below) |
|
||||
|
||||
@@ -64,6 +64,14 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
|
||||
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site settings | any upload/text field |
|
||||
| `whiteLabel.titleSuffix` | none | `admin.meta.titleSuffix` (tab title) | — |
|
||||
| `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks`: "Technology support: Intecion.com" (en/pl, from `agency`) | `false`; `{ text, url }` overrides |
|
||||
| `whiteLabel.signIn` | on (with `whiteLabel`) | the sign-in look: a dark panel with the client's logo (Site settings → Logo: JPEG / PNG / WebP / AVIF / GIF, fetched and checked by its bytes before it is printed, ≤ 512 KB, fits 240 × 72, no plate) or the site's name beside the form, "Administration panel", language links; both themes, a band above the form on a phone. Login, the 2FA screens and e-mail verification get it through `AdminLogo` / `SafeTotpView` (already in the import map: an upgrade needs no edit). No env var, no new field, no migration | `false` = Payload's own screens |
|
||||
| `whiteLabel.signIn.allScreens` | `false` (the starter writes `true`) | the look on forgot / reset password, create first user, logout and "unauthorized" too: adds the provider `SignInLook` — ONE new import-map entry, run `pnpm payload generate:importmap`. Production start: when `importMap.js` on disk lacks it, the provider is left out and the log says `[iapl] The sign-in look covers only the login and 2FA screens …` | `true` |
|
||||
| `whiteLabel.signIn.accent` | `#0070c0` | hex colour of the button, links and focus ring (anything that is not a hex colour is ignored); or CSS variables `--iapl-signin-*` on `:root` in the admin's `custom.scss` | `'#0b6e4f'` |
|
||||
| `whiteLabel.signIn.logoPlate` | `false` (the logo straight on the dark panel: upload one that works on dark) | `true` = a white plate behind the logo (dark letters) | — |
|
||||
| `whiteLabel.signIn.checkLogo` | on | the logo's file is fetched as an anonymous visitor gets it and its first bytes read (10-minute memory); a deleted / broken / non-image / > 512 KB file → the site's name; nothing answers → the upload document is believed | `false` = no fetch |
|
||||
| `whiteLabel.signIn.languages` | shown with 2+ admin languages | links on the panel; `GET /api/ipal/admin-language?lng=<code>` writes Payload's `payload-lng` cookie and redirects (303) back to the admin path of the `Referer`; unknown language → 400 | `false` = no links, no endpoint |
|
||||
| `whiteLabel.signIn.svgLogo` | `false`: an SVG logo is NOT shown on the sign-in screens (the site's name is) — tell the client to upload a PNG / WebP logo | `true` = shown as a picture (`<img>` runs no script) | — |
|
||||
| `whiteLabel.brandAccess` | `'admin'` with the sign-in look (else `'editor'`) | field-level `access.update` on the name, logo and icon fields of Site settings: only admins change what the sign-in screens show; editors keep the rest. No schema change | `'editor'` = whoever edits Site settings |
|
||||
| `agency` | `{ name: 'Intecion.com', url: 'https://intecion.com' }` | the credit line, the panel's link description and preview image | `{ name, url }` = another agency; `false` = none anywhere |
|
||||
| `adminMeta` | on (with or without `whiteLabel`) | panel `<head>`: `robots` noindex/nofollow, `titleSuffix` "— <site> \| Panel", `og:site_name` + description from Site settings (refreshed on save), `og:image` `GET /api/ipal/admin-og` (1200×630 from the logo or name), icon `GET /api/ipal/admin-icon` (favicon or initials); no import map step | `false` = Payload defaults; `{ robots, titleSuffix, description, image, icons, language }` (each `false` or your value; `{site}`, `{agency}` placeholders); your own `admin.meta` keys always win. Check: `curl -s $URL/admin/login \| grep -E 'og:\|robots'` (white-label.md) |
|
||||
| `pages` | none | Site settings → **System pages** (page roles) and **Maintenance** tabs | omit → neither tab |
|
||||
@@ -153,6 +161,7 @@ description: Complete map of everything @intecion/ipal-kit provides — every ia
|
||||
|---|---|---|
|
||||
| `AdminLogo`, `AdminIcon` | `graphics.Logo/Icon` | `whiteLabel` |
|
||||
| `IntecionCredit` | `afterLogin`, `afterNavLinks` | `whiteLabel` and `credit !== false` |
|
||||
| `SignInLook` | `providers` (last) | `whiteLabel.signIn.allScreens` — the only entry the sign-in look adds; without it nothing new is needed |
|
||||
| `StatsNavLink`, `StatsView` (`views.ipalStats`, `/stats`), `StatsWidget` (`beforeDashboard`) | nav, view, dashboard | `stats` (`dashboard: false` without the widget) |
|
||||
| `CookieScanButton` | `beforeListTable` of `cookie-review` (with **Check site** when `crawl` is on) | `cookieScanner` |
|
||||
| `CookieReviewTab`, `CookieSiteCheckTab` | `ui` fields in the `cookie-settings` tabs | `cookieScanner` with `adminLayout !== 'separate'` (Site check: `crawl`) |
|
||||
|
||||
@@ -38,6 +38,8 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
|
||||
| `TwoFactorResetButton` | `@intecion/ipal-kit/admin` | Client button inside `TwoFactorStatusField`: `POST /api/ipal/two-factor/reset` `{ userId }`, then reloads the view. Props `{ kind: 'reset' \| 'reopen', userId }`. |
|
||||
| `TwoFactorAlert` | `@intecion/ipal-kit/admin` | Server component on the dashboard (`beforeDashboard`), administrators only: accounts without two-step verification and how many are blocked. Wired by the plugin with `twoFactor.requireSetup`; renders nothing when every account has it. |
|
||||
| `IntecionCredit` | `@intecion/ipal-kit/admin` | The line "Technology support: Intecion.com" (admin language; `agency` prop = the name) below the nav and below the login form (`variant: 'nav' \| 'login'`). Injected by the plugin with `whiteLabel`; turn off: `whiteLabel: { credit: false }` or `agency: false`. |
|
||||
| `SignInPanel` | `@intecion/ipal-kit/admin` | Server component: the dark sign-in panel with its stylesheet (`<style>` deduplicated by React) — label, the logo or the site's name from Site settings as a link to the site, language links. Props `look` (`SignInLookProps`) plus what Payload injects (`payload`, `i18n`, `locale`, `user`); `SignInPanelProps`. Hidden by its own CSS on any page that is not Payload's minimal template. `AdminLogo` (prop `signIn`) and `SafeTotpView` (prop `iaplSignIn`) render it when the provider does not. |
|
||||
| `SignInLook` | `@intecion/ipal-kit/admin` | Admin provider (`admin.components.providers`, `serverProps: { look }`; `SignInLookProviderProps`): prints `SignInPanel` on every admin page so that every minimal screen has it. Registered by `whiteLabel: { signIn: { allScreens: true } }`. |
|
||||
| `buildAdminMeta({ agency, apiRoute?, defaultLocale?, meta?, options? })` | `@intecion/ipal-kit` | The `adminMeta` step: static panel meta (robots, preview image, icon) without overwriting keys in `meta`; returns `{ meta, resolved }` |
|
||||
| `adminMetaForSite(site, resolved)`, `syncAdminMeta(payload, resolved, { nameField?, settingsSlug? })` | `@intecion/ipal-kit` | Site-name parts (suffix, description, siteName); `syncAdminMeta` writes them into the live config (onInit + Site settings afterChange, never throws) |
|
||||
| `buildAdminImageEndpoints(resolved, { settingsSlug?, nameField?, logoField?, iconField? })` | `@intecion/ipal-kit` | `GET /api/ipal/admin-og` (1200×630 PNG via `next/og`) and `GET /api/ipal/admin-icon` (the favicon itself, or initials) — already added by `adminMeta` |
|
||||
@@ -622,7 +624,12 @@ Server only (`pnpm payload run`); never import it from client code, the Payload
|
||||
| `buildTwoFactorResetEndpoint(collection, { access?, ownOrigin? })`, `TWO_FACTOR_RESET_PATH` | `@intecion/ipal-kit` | `POST /api/ipal/two-factor/reset` `{ userId }`: clears the account's TOTP secret and sessions and starts a new window. `ownOrigin(req)` false → `403` before anything changes (the plugin passes the `twoFactor.sameOrigin` rule; wire `requestFromOwnOrigin` when you build it yourself). Default: a staff admin whose session entered its own TOTP code; `access` replaces that (only `true` allows; a session that owes its code is always refused). `iapl` registers it only with `twoFactor.guard` on. |
|
||||
| `countAccountsWithoutTotp(payload, collection, setupWindowMs?)` | `@intecion/ipal-kit` | `{ without, blocked }` — accounts of the 2FA collection without TOTP, and how many are past their window. |
|
||||
| `resolveRequireSetup(option)`, `strictExempt(fn)`, `SETUP_FROM_FIELD`, `DEFAULT_SETUP_WINDOW_HOURS` | `@intecion/ipal-kit` | `twoFactor.requireSetup` → `{ requireSetup, setupWindowMs, exempt? }` as the guard reads it (throws on a `windowHours` that is not a number ≥ 0 or `false`, and on an `async` `exempt`); the wrapper that makes an `exempt` function answer `true` only for exactly `true`; the field name `'totpSetupFrom'`; `72`. |
|
||||
| `fetchPublicImage(url, base)`, `publicImageDataUri(url, base)`, `rasterImageType(bytes)`, `siteOrigin(serverURL)`, `PUBLIC_IMAGE_MAX_BYTES` | `@intecion/ipal-kit` | An image fetched the way an anonymous visitor gets it (no cookies; http(s) only; `image/*`; at most 512 KB, reading stops at the limit) as `{ bytes, type }` or a `data:` address, else `null`. Used for the logo and icon on the 2FA screens. `rasterImageType(bytes)` → the media type of a bitmap by its first bytes (PNG, JPEG, GIF, WebP, ICO, AVIF) or `null` — never trust a claimed type before answering a file's bytes from the site's origin; an SVG gives `null`. |
|
||||
| `fetchPublicImage(url, base, { timeoutMs? }?)`, `publicImageDataUri(url, base)`, `rasterImageType(bytes)`, `siteOrigin(serverURL)`, `PUBLIC_IMAGE_MAX_BYTES`, `PUBLIC_IMAGE_TIMEOUT_MS` | `@intecion/ipal-kit` | An image fetched the way an anonymous visitor gets it, as `{ bytes, type }` or a `data:` address, else `null`: no cookies; http(s) only; `image/*`; ONE address — a redirect is never followed (a 3xx is "no image"); the whole exchange within `PUBLIC_IMAGE_TIMEOUT_MS` (5000); at most `PUBLIC_IMAGE_MAX_BYTES` (512 KB), reading stops at the limit whatever `content-length` says. `base` is the site's configured origin (`siteOrigin(config.serverURL)` = `serverURL`, else `NEXT_PUBLIC_SERVER_URL`) — never build it from a request's `Host` / `X-Forwarded-Host`. Used for the logo and icon on the 2FA screens and by `/api/ipal/admin-og` and `/api/ipal/admin-icon`. `rasterImageType`: the bitmap type by the first bytes (PNG, JPEG, GIF, WebP, ICO, AVIF), `null` for anything else, SVG included. |
|
||||
| `resolveSignInLook(whiteLabel)` | `@intecion/ipal-kit` | `whiteLabel` option → `null` (white-label or `signIn` off) or `{ allScreens, props }` (`ResolvedSignInLook`; `props` = `SignInLookProps`, the plain values the components get: `accent`, `checkLogo`, `imageField`, `inlineImages`, `languages`, `logoPlate`, `nameField`, `settingsSlug`, `svgLogo`). Option type: `SignInLookOptions`. |
|
||||
| `loadSignInBrand({ payload, look, locale?, user? })`, `signInName(value, locale?)`, `signInLogo(media, { svgLogo? })`, `checkLogoFile(url, base, allowSvg?)`, `fitLogo(width, height, box?)`, `isSvgUpload(media)`, `SIGN_IN_LOGO_TYPES` | `@intecion/ipal-kit` | What the sign-in panel shows: `{ name, logo }` (`SignInBrand`, `SignInLogo = { src, width?, height? }`) read from Site settings, never throwing; the name as one line of plain text (control characters out, cut at `SIGN_IN_NAME_MAX` = 80); the logo of an upload document — only JPEG / PNG / WebP / AVIF / GIF (`SIGN_IN_LOGO_TYPES`; SVG with `svgLogo: true`), only an `http(s)` or site-relative address, fitted into `SIGN_IN_LOGO_BOX` (240 × 72) without enlarging, served from the smallest generated size ≥ 2× the shown width with the same proportions; the look at the file itself (`LogoCheck`: `{ bytes, type }`, `'bad'` = the server answered and it is no such picture or over 512 KB, `'unknown'` = nothing answered). A session that owes its 2FA code gets the checked picture inlined or no logo. |
|
||||
| `signInCss({ accent? })`, `isHexColour(value)`, `SIGN_IN_STYLE_ID` | `@intecion/ipal-kit` | The stylesheet of the sign-in look as a string (no `url()`, no font, no other host; every rule needs `.iapl-signin` on the page), the hex check `accent` must pass, and the `href` of its `<style>` (`'iapl-sign-in'`). |
|
||||
| `languageLinks(config, current)`, `LANGUAGE_NAMES`, `buildAdminLanguageEndpoint()`, `adminPathFromReferer(referer, adminRoute)`, `ADMIN_LANGUAGE_PATH` | `@intecion/ipal-kit` | The panel's languages as links (`LanguageLink[]`: `{ code, name, current, href }`; empty with one language; names in their own language, else the code); the public endpoint `GET /api/ipal/admin-language?lng=` (`'/ipal/admin-language'`) that writes `<cookiePrefix>-lng` for a supported language (else 400) and answers 303 to a path inside the admin route taken from the `Referer` (anything else → the admin root, never another host). |
|
||||
| `signInProviderActive(payload)`, `SIGN_IN_LOOK` | `@intecion/ipal-kit` | Whether the provider `'@intecion/ipal-kit/admin#SignInLook'` is in the config AND in the running import map — `AdminLogo` and `SafeTotpView` print the panel themselves only when it is not. |
|
||||
| `UPLOAD_SECURITY_HEADERS` | `@intecion/ipal-kit` | The two headers of `buildUploadSecurityHeaders` (`Content-Security-Policy: default-src 'none'; … sandbox`, `X-Content-Type-Options: nosniff`) for a route of your own that returns an uploaded file's bytes from the site's origin. In a Next project a site-wide `headers()` rule with the same key overrides a header the route sets itself: add a `headers()` rule for the path after the site-wide one (as `buildUploadSecurityHeaders({ collections, adminIcon })` does for the upload routes and `/api/ipal/admin-icon`), and never answer with an SVG. |
|
||||
| `twoFactorSetupState(req)`, `twoFactorSetupDeadline(req)` | `@intecion/ipal-kit` | Where an account stands with TOTP setup, from `{ payload, user }`: `'set-up'`, `'open'` (may set it up now), `'closed'` (the setup window has passed: blocked until an admin reopens it), `'exempt'` (`requireSetup.exempt`, or `requireSetup: false`), `'not-applicable'` (no user, another collection, 2FA off); and the moment setup closes (`Date`, or `null` without a window). Types: `TwoFactorSetupState`, `RequireSetupOptions`. |
|
||||
| `requireSecondFactor(access?)` | `@intecion/ipal-kit` | Wraps an `Access` function: refused while the second factor is owed, otherwise the function itself (Payload's default "logged in" when none). iapl applies it to every collection and global in the config, and to those added by plugins listed after it (in `onInit` and at the start of the first request, so also after a dev hot reload); use it for access functions that are not part of the config. Per-entity opt-out: `custom.ipal.secondFactor: false \| { read: false }` or the package's `custom.totp.disableAccessWrapper`. Wrapping twice is harmless. |
|
||||
|
||||
@@ -188,7 +188,7 @@ export default buildConfig({
|
||||
seo: { collections: ['pages'] },
|
||||
forms: { redirectRelationships: ['pages'] },
|
||||
twoFactor: { issuer: '<Client name>', plugin: payloadTotp },
|
||||
whiteLabel: true,
|
||||
whiteLabel: { signIn: { allScreens: true } }, // client's logo / name on every sign-in screen (white-label.md)
|
||||
indexNow: true,
|
||||
// consentLog is on by default (1.17.0): consent-records + POST /api/ipal/consent; `consentLog: false` turns it off.
|
||||
// Postgres / SQLite: pnpm payload migrate:create consent-log, applied in the same deploy.
|
||||
@@ -207,7 +207,7 @@ are never added to a new site. Local `.env` with `PAYLOAD_SECRET` ≥ 32 charact
|
||||
One language: one entry in `locales`, no `[locale]` folder (i18n.md).
|
||||
|
||||
**Check.** `pnpm payload generate:importmap` (whiteLabel adds admin components) and `pnpm generate:types` without
|
||||
errors (the import map lists `@intecion/ipal-kit/admin#TotpRedirectProvider` and `#SafeTotpView`); `pnpm dev`, `/admin`: first-user screen → after saving, TOTP setup is enforced (`/admin/setup-totp?back=%2Fadmin`, QR, no reloading);
|
||||
errors (the import map lists `@intecion/ipal-kit/admin#TotpRedirectProvider`, `#SafeTotpView` and `#SignInLook`); `pnpm dev`, `/admin`: first-user screen → after saving, TOTP setup is enforced (`/admin/setup-totp?back=%2Fadmin`, QR, no reloading);
|
||||
the panel shows Site settings, Site integrations, Cookies, Form messages, the Forms group, Consent records.
|
||||
`curl -s -o /dev/null -w '%{http_code}' -X POST localhost:3000/api/ipal/consent -H 'content-type: application/json'
|
||||
-d '{"id":"0123456789abcdef","version":1,"state":{"necessary":true,"functional":false,"analytics":false,"marketing":false}}'` → `201`.
|
||||
@@ -296,6 +296,14 @@ the panel shows Site settings, Site integrations, Cookies, Form messages, the Fo
|
||||
win; a function `(global) => global` takes over). Without `revalidatePath` global saves wait for the ISR window.
|
||||
- `whiteLabel: { credit: false, titleSuffix, settingsSlug, logoField, … }`; with `whiteLabel` the plugin overrides
|
||||
`graphics.Logo/Icon` — your own graphics only without it.
|
||||
- Sign-in screens (`whiteLabel.signIn`, on): a dark panel with the client's logo or the site's name beside the
|
||||
form; the logo and name are Site settings fields (no env var, no migration). `allScreens: true` (in the config
|
||||
above) adds the provider `SignInLook` to the import map and covers forgot / reset password, first user and
|
||||
logout. The logo: JPEG / PNG / WebP / AVIF / GIF (an SVG logo shows the name: `svgLogo: true` or upload a
|
||||
bitmap), drawn for a DARK ground (no plate; `logoPlate: true` for a logo with dark letters). `accent: '#hex'`,
|
||||
`languages: false`, `checkLogo: false`; `signIn: false` = Payload's screens. Name, logo and icon in Site
|
||||
settings are admin-only with the look (`brandAccess: 'editor'` gives them back to editors).
|
||||
Check: `/admin/login` and `/admin/forgot` show the panel, also at a phone width; do not write login CSS by hand.
|
||||
- Panel link preview (`adminMeta`, on): noindex/nofollow, "— <site> | Panel" suffix, site name, description and
|
||||
preview image (`/api/ipal/admin-og`) from Site settings; `agency` names who supports the technology (default
|
||||
Intecion.com). Turn off: `adminMeta: false`, `agency: false`; your own `admin.meta` keys win. Check:
|
||||
|
||||
@@ -659,6 +659,27 @@ PROGRAMISTA §6, items 73–75; email.md; AGENT.md §7.2) — nothing to run; re
|
||||
**Send test e-mail** names the transport you expect; a form submission arrives. **The service is live at
|
||||
`https://webservices.intecion.net/mail`; while the service runs with enrolment "pending" (from its launch until Intecion switches to open enrolment), every new site waits for approval — keep SMTP until it is approved, or `relay: false`.**
|
||||
|
||||
**→ 1.17.1, the sign-in look (CHANGELOG 1.17.1; white-label.md → "The sign-in screens") — nothing is required:**
|
||||
1. **Sites with `whiteLabel`:** after the update the login screen and the 2FA screens (code, setup) have the new
|
||||
look — a dark panel with the client's logo or the site's name beside the form. No edit, no
|
||||
`generate:importmap`, no migration: the look comes through `AdminLogo` and `SafeTotpView`, which the site's
|
||||
import map already has. **Check:** open `/admin/login` on a desktop and at a phone width, in both themes; sign
|
||||
in through 2FA.
|
||||
**Look at the logo:** it stands straight on a dark panel. A logo with dark letters: `signIn: { logoPlate: true }`
|
||||
(a white plate) or ask the client for a logo for dark grounds. An **SVG** logo is not shown there (the site's
|
||||
name is): upload a PNG / WebP logo, or `signIn: { svgLogo: true }`.
|
||||
**Editors lose three fields:** the name, logo and icon of Site settings are admin-only now (they are what the
|
||||
public sign-in page shows). A site whose editors must change them: `whiteLabel: { brandAccess: 'editor' }`.
|
||||
2. **Tell the owner the sign-in page looks different** and ask whether to keep it. No: `whiteLabel: { signIn: false }`
|
||||
— Payload's screens with the plain logo, as before (record it in AGENTS.md → Project decisions).
|
||||
3. **Recommended, one edit:** `whiteLabel: { signIn: { allScreens: true } }`, `pnpm payload generate:importmap`,
|
||||
commit `importMap.js` — forgot / reset password, create first user and logout get the same look. Forgetting
|
||||
the import map does not break the panel: at a production start the provider is left out and the log says so.
|
||||
4. **Project CSS for the login screen** (`custom.scss` rules on `.login`, `.template-minimal`, a hand-made
|
||||
`graphics.Logo`): look at the screens after the update; the look's own rules win over Payload's layer but not
|
||||
over the project's later ones. Restyle with the `--iapl-signin-*` variables instead.
|
||||
5. Sites **without** `whiteLabel`: nothing changes.
|
||||
|
||||
## 2. Inventory (no code changes)
|
||||
**What changed for projects** between your old and new plugin version is exactly the reference site's diff —
|
||||
`git diff v<old> v<new> -- reference/` in the IAPL repo (or the two `docs/agent/reference-site/INDEX.md` files):
|
||||
|
||||
@@ -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.
|
||||
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
@@ -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.
|
||||
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
@@ -1,6 +1,6 @@
|
||||
# white-label — admin panel branding from the admin panel
|
||||
|
||||
The admin panel shows the **client's brand** (logo + name) on the login screen and in
|
||||
The admin panel shows the **client's brand** (logo + name) on the sign-in screens and in
|
||||
the navigation, taken from **SiteSettings** — i.e. set by the editor in the admin panel,
|
||||
not hard-coded. Each client logs in to "their own" panel.
|
||||
|
||||
@@ -45,6 +45,8 @@ whiteLabel: {
|
||||
| `iconField` | `'favicon'` | `graphics.Icon` → `AdminIcon` (max 28×28 px) |
|
||||
| `titleSuffix` | none (`adminMeta` builds one from the site name) | static `admin.meta.titleSuffix`, wins over `adminMeta` |
|
||||
| `credit` | `true` | `false` or `{ text?, url? }` |
|
||||
| `signIn` | `true` | the look of the sign-in screens (below); `false` = Payload's own screens; `{ allScreens, accent, logoPlate, languages, svgLogo, checkLogo }` |
|
||||
| `brandAccess` | `'admin'` with the sign-in look | who may change the name, logo and icon fields of Site settings: admins only (field-level access, no schema change); `'editor'` = whoever edits Site settings, as before |
|
||||
|
||||
The plugin overrides `admin.components.graphics.Logo` / `Icon` from the project config (its
|
||||
values win over yours); `afterLogin` / `afterNavLinks` are appended.
|
||||
@@ -98,6 +100,12 @@ image. The plugin now fills the panel's `<head>` from Site settings, **with or w
|
||||
(`syncAdminMeta`). Keys you set in `admin.meta` are never touched.
|
||||
- **The image** is drawn on the server with `next/og` (no external service, cached 1 h). The logo is
|
||||
read from the upload itself: PNG, JPG, GIF or SVG; a WebP/AVIF logo falls back to the site name.
|
||||
- **How the server fetches the logo and icon (1.17.1):** a site-relative upload address is resolved against the
|
||||
site's **configured** origin — `serverURL`, else `NEXT_PUBLIC_SERVER_URL` — never against the request's `Host`
|
||||
or `X-Forwarded-Host` (the endpoints are public; a request names its own host). No configured origin: a
|
||||
relative address is not fetched (the site name / the redirect to the media file is used). One address is
|
||||
asked, **a redirect is never followed**, the whole exchange has 5 s, and reading stops at 512 KB whatever
|
||||
the server says about the length. Set `serverURL` (every IAPL site does) for the logo to appear.
|
||||
The image endpoints are public (link previews fetch without a session) and show only the logo and
|
||||
name the site shows anyway. Fields: `whiteLabel.settingsSlug` / `nameField` / `logoField` / `iconField`.
|
||||
- **No import map step** — no new admin components (endpoints only).
|
||||
@@ -109,12 +117,138 @@ image. The plugin now fills the panel's `<head>` from Site settings, **with or w
|
||||
`og:site_name` = the site name, `og:image` = `/api/ipal/admin-og`; open `$URL/api/ipal/admin-og` → the
|
||||
preview image; paste the link in Slack → the site's name and image.
|
||||
|
||||
## Logo on the login screen
|
||||
## The sign-in screens — `whiteLabel.signIn` (on by default with `whiteLabel`)
|
||||
|
||||
`AdminLogo` is the LARGE logo on the login screen (Payload uses `graphics.Icon` for
|
||||
the small icon in the navigation). It renders quite a bit larger (`maxHeight 120 / maxWidth
|
||||
420`), so the client's brand is clear at login. The small nav icon is `favicon`
|
||||
through `AdminIcon`.
|
||||
One look for every screen a person passes before the panel: **a dark panel with the client's logo — or the site's
|
||||
name — beside the form**, the same look as the WordPress sibling (IAWL). On a phone the panel is a band above the
|
||||
form. The panel is dark in both themes; the form's side follows the admin theme (light or dark).
|
||||
|
||||
| On the panel | From | When it is missing |
|
||||
|---|---|---|
|
||||
| Label "Administration panel" (pl: "Panel administracyjny") | the plugin's texts (`ipal:signInPanelLabel`) | — |
|
||||
| The client's logo, a link to the site | Site settings → **Logo** (`logoField`) | the site's name |
|
||||
| The site's name, a link to the site | Site settings → **Site name** (`nameField`) | the site's host, then nothing |
|
||||
| Languages of the panel, as links | `i18n.supportedLanguages` (IAPL turns on English and Polish) | hidden with one language |
|
||||
|
||||
**Nothing is set in `.env` or in code: the logo and the name are the two fields of Site settings the public site
|
||||
uses too.** No new field, collection or global — so **no migration on Postgres / SQLite** and no change for MongoDB.
|
||||
With nothing set, the panel shows the label and the site's host: no Intecion and no Payload mark is put on a
|
||||
client's sign-in page (the credit line under the form is separate: `credit: false`).
|
||||
|
||||
**The logo — the same rules as on the WordPress sibling (IAWL):**
|
||||
|
||||
- **Types:** JPEG, PNG, WebP, AVIF, GIF. **No SVG** (`svgLogo: true` allows it; IAWL has no such switch because
|
||||
WordPress refuses the upload — Payload accepts SVG uploads, so a site whose logo is an SVG shows its **name** on
|
||||
the sign-in screens until it uploads a bitmap or sets the option).
|
||||
- **Looked at before it is printed:** the server fetches the file as an anonymous visitor would (at most 512 KB)
|
||||
and reads its first bytes. A deleted, broken, renamed, non-image or too large file gives the site's name, never
|
||||
a broken picture. A redirect is never followed by the server. The answer is remembered for ten minutes. When nothing answers at all (a container that cannot
|
||||
reach its own public address), the upload document is believed. `checkLogo: false` turns the look off.
|
||||
- **Size:** fits 240 × 72 px (192 × 56 on a phone), never enlarged or cropped, `width` and `height` set (no
|
||||
layout shift). Served from the smallest generated size (`imageSizes` of the media collection) that is at least
|
||||
twice the shown width and has the same proportions; else the upload itself. Recommended: PNG or WebP, 480 px
|
||||
wide or more, without empty margins.
|
||||
- **Ground: no plate by default** — the logo stands straight on the dark panel, so Site settings should hold a
|
||||
logo that works on a dark ground (the owner's choice for new surfaces). A logo drawn for light grounds (dark
|
||||
letters) sets `signIn: { logoPlate: true }` and gets a white plate. *IAWL differs here today:* its default is the
|
||||
plate, with `logoMadeFor => 'dark'` to leave it out.
|
||||
- **Text and link:** the alternative text is the site's name; logo and name link to the site's home page.
|
||||
|
||||
### Which screens
|
||||
|
||||
| Screens | How they get the look | What the project does |
|
||||
|---|---|---|
|
||||
| Login; the 2FA code, 2FA setup and "2FA setup required" screens; e-mail verification | through `AdminLogo` and `SafeTotpView` — components **already in the import map** of every site with `whiteLabel` / 2FA | nothing: an upgrade needs no edit and no `generate:importmap` |
|
||||
| Forgot password, reset password, create first user, logout, "unauthorized" | one admin provider, `SignInLook` | `whiteLabel: { signIn: { allScreens: true } }`, then `pnpm payload generate:importmap` and commit the map |
|
||||
|
||||
```ts
|
||||
iapl({
|
||||
whiteLabel: { signIn: { allScreens: true } }, // the project starter writes this for new sites
|
||||
})
|
||||
```
|
||||
|
||||
**Every sign-in screen (`allScreens`).** It adds `@intecion/ipal-kit/admin#SignInLook` to `admin.components.providers`
|
||||
— the one new import-map entry of this feature, which is why it is not on by default: a site must upgrade without
|
||||
touching its map. A provider the map lacks would render nothing, the whole panel included, so in production the
|
||||
plugin looks for the entry in `importMap.js` on disk at start and **leaves the provider out when it is not there**:
|
||||
the login and 2FA screens keep the look, and the log says `[iapl] The sign-in look covers only the login and 2FA
|
||||
screens … Run "pnpm payload generate:importmap"`. Without `allScreens` the other screens are Payload's own.
|
||||
|
||||
### Options
|
||||
|
||||
| `signIn:` | Default | Meaning |
|
||||
|---|---|---|
|
||||
| `false` | — | Payload's own sign-in screens; `AdminLogo` is the plain logo, as before |
|
||||
| `allScreens` | `false` | the look on every sign-in screen (above) |
|
||||
| `accent` | the shared blue `#0070c0` | a hex colour for the button, the links and the focus ring; it carries white text, so check its contrast (4.5:1) |
|
||||
| `logoPlate` | `false` | `true`: a white plate behind the logo (a logo with dark letters) |
|
||||
| `languages` | shown when the panel has 2+ languages | `false`: no language links, and no `/api/ipal/admin-language` endpoint |
|
||||
| `svgLogo` | `false` | `true`: an SVG logo is shown too (as a picture, where it cannot run script) |
|
||||
| `checkLogo` | `true` | `false`: the logo's file is not fetched and looked at before it is printed |
|
||||
|
||||
**Language links.** Plain links, no script: `GET /api/ipal/admin-language?lng=pl` writes Payload's own language
|
||||
cookie (`payload-lng`, one year) and sends the browser back to the admin page it came from. Public, because nobody
|
||||
is signed in yet; it accepts only a language the panel supports (else `400`) and returns only to a path inside the
|
||||
admin route (taken from the `Referer`; anything else → the admin root), so it cannot be used to send someone to
|
||||
another site.
|
||||
|
||||
### What a public page may show — the security rules
|
||||
|
||||
The sign-in page is open to anyone, so what reaches it is narrow on purpose:
|
||||
|
||||
- **Text:** the site's name only, as plain text (escaped; one line, at most 80 characters). No description, no
|
||||
rich text, no link an editor can write: the panel's only links are the site's own root and the language links.
|
||||
- **Pictures:** the logo as an `<img>`, bitmaps only (above), checked by its bytes, at most 512 KB; only an
|
||||
`http(s)` or site-relative address is used. The plugin serves **no new file** for it: the logo is the media file
|
||||
at its own address, with the media collection's own headers and cache rules. On the 2FA screens (the session is
|
||||
refused `media`) the picture that was just checked is put into the page as a `data:` image; when it could not
|
||||
be fetched the name is shown (`inlineImages`, above).
|
||||
- **Who can change it: admins.** With the sign-in look on, the three brand fields of Site settings (name, logo,
|
||||
icon) get field-level access for admins only; an editor still edits every other Site setting and sees these
|
||||
three read-only. No schema change. `whiteLabel: { brandAccess: 'editor' }` gives them back to editors.
|
||||
- **Accounts:** the forms, their messages and their limits are Payload's and the 2FA package's own, untouched.
|
||||
The look adds no text that depends on an account, so nothing new says whether an account exists.
|
||||
- **The stylesheet** is inline, has no `url()`, no font file and no request to another host; `accent` is accepted
|
||||
only as a hex colour. No script is added to the login screen. On the 2FA screens one small client component
|
||||
gives the six code boxes a name for screen readers ("Digit 2 of 6") and the numeric keyboard; it changes
|
||||
attributes only.
|
||||
|
||||
### Accessibility
|
||||
|
||||
Label and name contrast on the panel ≥ 7:1; text, links and the button on the form's side ≥ 4.5:1 in both themes;
|
||||
a visible focus ring on every control; no animation except the button's colour change, and none with
|
||||
`prefers-reduced-motion`; Windows high-contrast keeps the panel's edge; no sideways scroll from 320 px; the logo's
|
||||
alternative text is the site's name; the language links are a `<nav>` named "Language" with the current one marked
|
||||
(`aria-current`). The stylesheet and the panel come in the page's own response and are put on the page in the same
|
||||
step as the form: no flash of Payload's plain screen and no layout shift.
|
||||
A browser without `:has()` (Firefox before 121) shows Payload's plain layout.
|
||||
|
||||
### Restyle it
|
||||
|
||||
Set the custom properties on `:root` in the admin's `custom.scss` (the defaults have no specificity):
|
||||
`--iapl-signin-primary`, `--iapl-signin-primary-hover`, `--iapl-signin-primary-text`, `--iapl-signin-link`,
|
||||
`--iapl-signin-focus`, `--iapl-signin-bg`, `--iapl-signin-text`, `--iapl-signin-muted`, `--iapl-signin-border`,
|
||||
`--iapl-signin-field-border`, `--iapl-signin-panel`, `--iapl-signin-panel-text`, `--iapl-signin-panel-label`,
|
||||
`--iapl-signin-panel-glow` (three numbers, `R G B`), `--iapl-signin-panel-radius`, `--iapl-signin-panel-inset`,
|
||||
`--iapl-signin-split` (the panel's share of the width), `--iapl-signin-radius`. Classes you may rely on:
|
||||
`iapl-signin` (with `iapl-signin--logo` or `iapl-signin--name`), `iapl-signin__label`, `iapl-signin__brand`
|
||||
(`--plate`, `--name`), `iapl-signin__languages`, `iapl-credit--login`.
|
||||
|
||||
### Your own screens, or none
|
||||
|
||||
- **Off:** `whiteLabel: { signIn: false }` — Payload's screens with the plain logo; nothing else changes.
|
||||
- **Your own logo in code:** set `admin.components.graphics.Logo` yourself and do not use `whiteLabel` (the plugin's
|
||||
`Logo` wins while `whiteLabel` is on); or keep `whiteLabel` and filter what Site settings holds.
|
||||
- **Your own panel:** `SignInPanel` (the panel with its stylesheet) and `SignInLook` (the provider) are exported
|
||||
from `@intecion/ipal-kit/admin`; wire them in `admin.components` with `serverProps: { look: { … } }`
|
||||
(`SignInLookProps`). From the main entry: `resolveSignInLook`, `loadSignInBrand`, `signInLogo`, `signInName`,
|
||||
`checkLogoFile` (`LogoCheck`), `SIGN_IN_LOGO_TYPES`, `fitLogo`, `isSvgUpload`, `languageLinks`, `LANGUAGE_NAMES`, `signInCss`, `isHexColour`, `signInProviderActive`,
|
||||
`buildAdminLanguageEndpoint`, `adminPathFromReferer`, and the constants `SIGN_IN_LOOK`, `SIGN_IN_STYLE_ID`,
|
||||
`SIGN_IN_LOGO_BOX`, `SIGN_IN_NAME_MAX`, `ADMIN_LANGUAGE_PATH`; types `SignInLookOptions`, `ResolvedSignInLook`,
|
||||
`SignInLookProps`, `SignInBrand`, `SignInLogo`, `LanguageLink`, `SignInPanelProps`, `SignInLookProviderProps`.
|
||||
- **Verify:** `curl -s $URL/admin/login | grep -c 'class="iapl-signin'` → `1`; open `/admin/login` at a phone
|
||||
width; with `allScreens`, `curl -s $URL/admin/forgot | grep -c 'class="iapl-signin'` → `1`;
|
||||
`curl -si "$URL/api/ipal/admin-language?lng=xx"` → `400`.
|
||||
|
||||
## How it works
|
||||
|
||||
@@ -141,15 +275,18 @@ through `AdminIcon`.
|
||||
|
||||
- [ ] `iapl({ whiteLabel: true })`
|
||||
- [ ] The editor uploaded `logo` and `favicon` in SiteSettings (+ `siteName`)
|
||||
- [ ] `signIn: { allScreens: true }` for the look on every sign-in screen (new sites: yes)
|
||||
- [ ] `pnpm generate:importmap`
|
||||
- [ ] Restart dev / rebuild → the panel shows the client's brand on login and in the nav
|
||||
|
||||
## Turn off, override, extend
|
||||
|
||||
- **Turn off:** without `whiteLabel` (default) the panel has Payload branding; `credit: false` hides the credit;
|
||||
- **Turn off:** without `whiteLabel` (default) the panel has Payload branding; `signIn: false` keeps Payload's
|
||||
sign-in screens; `credit: false` hides the credit;
|
||||
`agency: false` removes the agency everywhere; `adminMeta: false` restores Payload's link preview.
|
||||
- **Override:** other fields / global (`settingsSlug`, `nameField`, `logoField`, `iconField`), credit text and URL,
|
||||
`titleSuffix`. With `whiteLabel` on, the plugin overrides `graphics.Logo` / `Icon` from the project
|
||||
config — set your own graphics components without `whiteLabel`.
|
||||
- **Extend:** `AdminLogo`, `AdminIcon`, `IntecionCredit` (props `agency`, `text`, `url`, `variant`) from
|
||||
`@intecion/ipal-kit/admin` can be wired manually into `admin.components` with your own `serverProps`.
|
||||
- **Extend:** `AdminLogo`, `AdminIcon`, `IntecionCredit` (props `agency`, `text`, `url`, `variant`), `SignInPanel`
|
||||
and `SignInLook` from `@intecion/ipal-kit/admin` can be wired manually into `admin.components` with your own
|
||||
`serverProps`.
|
||||
|
||||