diff --git a/docs/agent/AGENT.md b/docs/agent/AGENT.md index 94f4466..22257ea 100644 --- a/docs/agent/AGENT.md +++ b/docs/agent/AGENT.md @@ -1171,7 +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). Options: `accent` (hex), `logoMadeFor: 'dark'`, `languages: false`, `svgLogo: false`; `signIn: false` = Payload's screens; `brandAccess: 'admin'` = only admins change name / logo / icon. 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" | +| 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 | diff --git a/docs/agent/skills/iapl-reference/SKILL.md b/docs/agent/skills/iapl-reference/SKILL.md index 360f9b8..7d290a1 100644 --- a/docs/agent/skills/iapl-reference/SKILL.md +++ b/docs/agent/skills/iapl-reference/SKILL.md @@ -64,13 +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, on a white 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` | 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.logoMadeFor` | `'light'` | `'dark'` = a logo drawn for dark grounds: no white plate | — | +| `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=` 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` | shown as a picture (`` runs no script) | `false` = an SVG logo is not shown on the sign-in screens; the site's name is | — | -| `whiteLabel.brandAccess` | `'editor'` (whoever edits Site settings) | `'admin'` = field-level `access.update` on the name, logo and icon fields: only admins change what the sign-in screens show. No schema change | — | +| `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 (`` 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 ``: `robots` noindex/nofollow, `titleSuffix` "— \| 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 | diff --git a/docs/agent/skills/iapl-reference/resources/api.md b/docs/agent/skills/iapl-reference/resources/api.md index 36bcd47..3423cc6 100644 --- a/docs/agent/skills/iapl-reference/resources/api.md +++ b/docs/agent/skills/iapl-reference/resources/api.md @@ -625,8 +625,8 @@ Server only (`pnpm payload run`); never import it from client code, the Payload | `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`. | -| `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`, `imageField`, `inlineImages`, `languages`, `logoMadeFor`, `nameField`, `settingsSlug`, `svgLogo`). Option type: `SignInLookOptions`. | -| `loadSignInBrand({ payload, look, locale?, user? })`, `signInName(value, locale?)`, `signInLogo(media, { svgLogo? })`, `fitLogo(width, height, box?)`, `isSvgUpload(media)` | `@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 an `http(s)` or site-relative address; `null` for SVG with `svgLogo: false`), fitted into `SIGN_IN_LOGO_BOX` (240 × 72) without enlarging. A session that owes its 2FA code gets the picture inlined (`publicImageDataUri`) or no logo. | +| `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 `