Skip to main content

DefaultPasswordValidationStrategy

The DefaultPasswordValidationStrategy allows you to specify a minimum length and/or a regular expression to match passwords against. The default maxLength is 72.

TODO: By default, the minLength will be set to 4. This is rather permissive and is only this way in order to reduce the risk of backward-compatibility breaks. In the next major version this default will be made more strict.

Signature

constructor

method(options: { minLength?: number; maxLength?: number; regexp?: RegExp }) => DefaultPasswordValidationStrategy

validate

method(ctx: RequestContext, password: string) => boolean | string
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page