From 9ac56bc79488e61004518ede28f241006c83063e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 1 Dec 2026 11:25:25 +0100 Subject: [PATCH] Docs: SIGN_IN_RULES_MARK; reference types with the field's description Co-Authored-By: Claude Opus 5.5 --- docs/access.md | 2 +- docs/agent/skills/iapl-reference/resources/api.md | 2 +- reference/src/payload-types.ts | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/access.md b/docs/access.md index 8fc04e9..dcfa4a2 100644 --- a/docs/access.md +++ b/docs/access.md @@ -542,7 +542,7 @@ current passwords count like failed sign-ins (`signInLimit`). The field is virtu → `200`. In the panel: Account → the new e-mail and "Current password" → saved. - **Building blocks** of the three rules: `applySignInRules(collection, accounts)`, `buildSignInBeforeOperation`, `releaseSignInPlace` (`afterLogin`), `settleFailedSignIn` (config `afterError`), `buildCurrentPasswordField`, - `resolveSignInRules`, `foldSignInName`, `passwordMatches`, `CURRENT_PASSWORD_FIELD`; `releaseRateLimit` (gives a + `resolveSignInRules`, `foldSignInName`, `passwordMatches`, `CURRENT_PASSWORD_FIELD`, `SIGN_IN_RULES_MARK` (on the hook); `releaseRateLimit` (gives a place of `consumeRateLimit` back — for limiters that count failures only). ## Turn off, override, extend diff --git a/docs/agent/skills/iapl-reference/resources/api.md b/docs/agent/skills/iapl-reference/resources/api.md index d720d0d..90cf595 100644 --- a/docs/agent/skills/iapl-reference/resources/api.md +++ b/docs/agent/skills/iapl-reference/resources/api.md @@ -85,7 +85,7 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT | `buildRolesField(defaultRole?, { firstUserAdmin? })` | `@intecion/ipal-kit` | The `roles` select field the plugin injects (only admins set roles; `firstUserAdmin` default `true` = the account made on "Create first user" gets `admin`). The plugin wires it itself — use it only for an auth collection the plugin does not manage. | | `injectRoles(config, accessOption)` | `@intecion/ipal-kit` | Adds `roles` to `accessOption.authCollection` in a config. The plugin calls it itself with `access` — do not call. | -| `applySignInRules(collection, accounts?)`, `buildSignInBeforeOperation(slug, rules)`, `releaseSignInPlace`, `settleFailedSignIn`, `buildCurrentPasswordField()`, `resolveSignInRules(accounts?)`, `foldSignInName(value)`, `passwordMatches({ hash, salt }, password)`, `CURRENT_PASSWORD_FIELD`; types `SignInRulesOptions`, `SignInLimitOptions`, `SignInSameOriginOptions` | `@intecion/ipal-kit` | 1.18.0, `accounts.signInLimit` / `signInSameOrigin` / `confirmOwnChanges`: the three rules on one staff collection (hooks, field, Payload lock defaults); the `beforeOperation` hook; the `afterLogin` hook that gives a sign-in's place back; the config `afterError` hook that ends a failed one; the virtual "Current password" field; the options with defaults; the address folding (NFKC, lower case, trim); Payload's stored-hash check (unknown formats refused). | +| `applySignInRules(collection, accounts?)`, `buildSignInBeforeOperation(slug, rules)`, `releaseSignInPlace`, `settleFailedSignIn`, `buildCurrentPasswordField()`, `resolveSignInRules(accounts?)`, `foldSignInName(value)`, `passwordMatches({ hash, salt }, password)`, `CURRENT_PASSWORD_FIELD`, `SIGN_IN_RULES_MARK` (the mark on the `beforeOperation` hook); types `SignInRulesOptions`, `SignInLimitOptions`, `SignInSameOriginOptions` | `@intecion/ipal-kit` | 1.18.0, `accounts.signInLimit` / `signInSameOrigin` / `confirmOwnChanges`: the three rules on one staff collection (hooks, field, Payload lock defaults); the `beforeOperation` hook; the `afterLogin` hook that gives a sign-in's place back; the config `afterError` hook that ends a failed one; the virtual "Current password" field; the options with defaults; the address folding (NFKC, lower case, trim); Payload's stored-hash check (unknown formats refused). | | `releaseRateLimit({ key, scope, max?, windowMs?, cost? })` | `@intecion/ipal-kit` | Gives back a place `consumeRateLimit` took (memory: never below 0; a store: `hit(id, -cost)`) — for a limiter that counts failures only. | **Types:** `AccountsOptions` (`accounts`: `panelRole`, `adminOnlyCreate`, `adminOnlyWrite`, `staffOnlyRead`, `firstUserRoute`, `password`, `signInLimit`, `signInSameOrigin`, `confirmOwnChanges`), `StaffAccountAccessOptions` (`{ create?, write?, read?, pluginRoles? }`), `StaffRuleMark` (`{ slug, self }`), `AccountsMarker` (`{ slug, staff, own? }`, in `custom.ipalAccounts`; `own`: the operations that had a rule of the project's at config time, kept when the collection becomes staff later), `LateAdoption` (`{ slug, applied, kept, known, password, firstUser }`; `known`: in the config when iapl ran and staff only afterwards, `kept`: its operations whose own rule was left as written), `StaffAccountRules` (what the plugin put on a staff collection, in `custom.ipalAccountRules`: `{ applied, ownRoles }`), `WriteOnlySecretOptions` (`{ boundTo?, appliesWhen? }`), `PasswordRuleOptions` (`{ minLength? }`), `FirstUserRouteOption` (`'panel' \| 'all' \| string[]`), `TurnstileOnConfigError` / `TurnstileOnConfigErrorOption` / `TurnstileFormKind` (`@intecion/ipal-kit/server`), `VerifyLimitOptions` (`twoFactor.verifyLimit`: `{ max?, windowMinutes?, store? }`), `RequireSetupOptions` (`twoFactor.requireSetup`), `TwoFactorResetOptions`, `TwoFactorSetupState`, `SafeBackRule` / `SafeBackContext` (`twoFactor.safeBack` as a function: `(back, { adminRoute, origin? }) => string`), `TotpViewComponent` (a view component as registered: a path or `{ path, exportName?, clientProps?, serverProps? }`), `SafeTotpViewProps` (`@intecion/ipal-kit/admin`), `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (the plugin's `access` option: `authCollection`, `defaultRole`, `authAccess`, `firstUserAdmin`, `staffCollections`). diff --git a/reference/src/payload-types.ts b/reference/src/payload-types.ts index 76aadc7..d9f5e6c 100644 --- a/reference/src/payload-types.ts +++ b/reference/src/payload-types.ts @@ -1290,6 +1290,9 @@ export interface CaseStudy { */ export interface User { id: string; + /** + * Needed only to change your own e-mail address or password. + */ currentPassword?: string | null; totpSecret?: string | null; hasTotp?: boolean | null;