Enforces composable password rules on Payload auth collections through a beforeValidate hook and a password field validator. It covers create, update and resetPassword, and all checks run offline. Requires Payload 3 and is configured by registering the plugin in the Payload config.
Configurable password strength and policy enforcement plugin for Payload CMS
Installation
npm i @payload-kit/password-policy0
Stars
0
Forks
3
Open Issues
Yesterday
Last Updated
690
Weekly Downloads
v0.1.0-alpha.1
npm Version
49.1 KB
Unpacked Size
0
Dependencies
00 since Nov 22
| Date | Stars |
|---|---|
| Dec 6, 2026 | 0 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
Shared by 5 plugins in gngz/payload-kit.
Trends appear after 7 days of data. Collecting since Dec 2 — 5 daily snapshots so far.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1474969753-password-policy)<a href="https://payloaddirectory.dev/plugins/1474969753-password-policy"><img src="https://payloaddirectory.dev/badge/1474969753-password-policy.svg" alt="Payload Directory"></a>README
Password policy plugin for Payload CMS. Enforces composable, localized password rules on auth collections through both a beforeValidate hook and a password field validator (covering create, update, and resetPassword).
pnpm add @payload-kit/password-policy
Peer dependency: payload (^3.0.0).
Register passwordPolicyPlugin in payload.config.ts:
import { buildConfig } from "payload";
import { passwordPolicyPlugin } from "@payload-kit/password-policy";
export default buildConfig({
plugins: [
passwordPolicyPlugin({
minLength: 12,
maxLength: 128,
defaultLocale: "en",
}),
],
});
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enables or disables the plugin. When false, returns the config unchanged. |
collections | string[] | all auth collections | Target collection slugs. When omitted, applies to every collection with auth enabled. |
minLength | number | 12 | Minimum password length. |
maxLength | number | 128 | Maximum password length. |
requireLowercase | boolean | true | Requires at least one lowercase letter. |
requireUppercase | boolean | true | Requires at least one uppercase letter. |
requireNumber | boolean | true | Requires at least one digit. |
requireSpecialChar | boolean | true | Requires at least one non-alphanumeric character. |
rejectCommonPasswords | boolean | true | Rejects common password fragments, including leetspeak variants (P@ssw0rd). |
rejectWeakPatterns | boolean | true | Rejects repeated runs (aaaa), sequences (1234, wxyz), keyboard runs (qwerty, azerty), and repeated blocks (Ab1!Ab1!Ab1!). |
rejectPersonalInfo | boolean | true | Rejects passwords containing the user's name, email local part, or username. |
personalInfoFields | string[] | ["email", "name", "username"] | Document fields checked by the personal-info rule. |
extraRules | readonly PasswordRule[] | undefined | Additional rules appended after the built-in rules. Each rule receives (password, context) with context.data. |
passwordRules | readonly PasswordRule[] | undefined | Custom ruleset that replaces the built-in flags and extraRules. |
defaultLocale | string | "pt" | Fallback locale when a rule has no message for the resolved request locale. |
resolveLocale | (req: PayloadRequest) => string | undefined | Custom locale resolver for validation error messages. |
password field inside layout containers (tabs, row, or collapsible), the plugin does not auto-attach its field-level validator to nested fields—use createPasswordField(options, overrides?) so resetPassword and the Admin UI enforce the exact same policy.defaultLocale defaults to "pt". Set defaultLocale: "en" for English-first projects.passwordPolicyPlugin, createPasswordField, buildPasswordRules, createPasswordValidator, validatePassword, DEFAULT_PASSWORD_RULES, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, and types PasswordLocale, PasswordPolicyOptions, PasswordPolicyPluginOptions, PasswordRule, PasswordRuleContext.
MIT
payload zitadel plugin
Log in to the Mzinga admin through Zitadel or another OIDC provider using authorization code with PKCE
72608/wk11v?
payload auth
Replace Payload's built-in auth with Better Auth for a shared admin and frontend session
7021.0k/wk349v3
oidc
OpenID Connect single sign-on for Payload using Authorization Code Flow with PKCE and native Payload sessions
65745/wk0v3
payload github auth
Sign in to the Payload admin with a GitHub App, with access rules by email, org or team
6021/wk0v4
payload keycloak
Keycloak SSO-only authentication for Payload 3 using OIDC with PKCE and permission-based access helpers
5511/wk0v3
payload better auth
Integrate Better Auth into Payload CMS 3 with generated collections, API endpoints and admin login
3474v3