2FA screens: plain en/pl texts and tab title; CookieButton moves up above the footer
- TOTP_TEXTS (admin-ux.md wording) merged over @clocklimited/payload-2fa's long, informal texts; the project's i18n.translations still win; twoFactor.texts: false keeps the package's. Setup/verify screens titled "Two-step verification" / "Weryfikacja dwuetapowa" instead of "Payload". - CookieButton: position via --ipal-cookie-button-offset / -inset and --ipal-z-header; lifts above the footer (avoid, default COOKIE_BUTTON_AVOID) while it is on screen; side prop; className still replaces the look. - dev: a footer in the frontend layout to check the button against. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d992d131a2
commit
2886c89d8a
@@ -402,6 +402,22 @@ pnpm generate:importmap
|
||||
`src/app/(payload)/admin/importMap.js` must list `@intecion/ipal-kit/admin#TotpRedirectProvider` and
|
||||
`@clocklimited/payload-2fa/rsc#TOTPSetup` / `#TOTPVerify` / `#TOTPField`. Commit the file.
|
||||
|
||||
### Texts of the 2FA screens (`twoFactor.texts`)
|
||||
|
||||
The setup and verify screens and the user field read their texts through Payload's i18n
|
||||
(`totpPlugin:*`), in the user's admin language (*Account → Language*; without a choice, the
|
||||
browser's language — an English browser sees English screens on a Polish site). The package's own texts are long and informal,
|
||||
so ipal-kit merges `TOTP_TEXTS` (English and Polish, per `docs/dev/admin-ux.md`) over them, e.g.
|
||||
"Two-step verification" / "Weryfikacja dwuetapowa", "Enter the 6-digit code from the app:" /
|
||||
"Wpisz 6-cyfrowy kod z aplikacji:". The browser tab reads "Weryfikacja dwuetapowa — <site> | Panel"
|
||||
(`TOTP_VIEW_TITLE` in the site's default language: Payload's view title is a plain string).
|
||||
|
||||
- **Override one text:** `i18n.translations.<lang>.totpPlugin.<key>` in your config — your keys win
|
||||
over both sets.
|
||||
- **Keep the package's texts:** `twoFactor: { …, texts: false }`.
|
||||
- **Not translatable:** a network failure while sending the code shows the package's hardcoded
|
||||
"Something went wrong" toast (rare: the server's own errors are translated).
|
||||
|
||||
### The redirect to the 2FA screens (`twoFactor.provider`)
|
||||
|
||||
The package's own admin provider decides on the server where to send the user, from an `x-pathname`
|
||||
|
||||
Reference in New Issue
Block a user