Files
ipal-kit/docs/dev/login-page/changelog-draft.md
T
Radosław SmolińskiandClaude Fable 5.2 aef1efac73 Public brand image fetch: the site's configured origin only, no redirect followed, a time and a byte limit
/api/ipal/admin-og resolved a relative logo address against the request's own host and fetched it with
Node's defaults (redirects followed, no timeout, no size cap); /api/ipal/admin-icon resolved the same way.
Both now resolve against serverURL / NEXT_PUBLIC_SERVER_URL (never the request) and fetch through
fetchPublicImage, which asks one address with redirect: 'manual' (a 3xx is no image), within
PUBLIC_IMAGE_TIMEOUT_MS, reading at most 512 KB. The renderer still draws PNG, JPEG, GIF (by their bytes)
and SVG (by its type, as before). Tests against local servers: hostile Host / X-Forwarded-Host, a 302 to an
internal host, an endless body, a hanging server, the normal logo. Docs say 1.17.1 instead of 1.18.0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:03:52 +01:00

71 lines
5.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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.