fix: definitions for accountLockout and passwordPolicy (#7040)

* fix: definitions for accountLockout and passwordPolicy

* redo env prefix
This commit is contained in:
dblythy
2020-12-04 08:03:29 +11:00
committed by GitHub
parent c8ff445c10
commit e634eba57c
4 changed files with 104 additions and 19 deletions

View File

@@ -128,9 +128,9 @@ export interface ParseServerOptions {
:DEFAULT: false */
emailVerifyTokenReuseIfValid: ?boolean;
/* account lockout policy for failed login attempts */
accountLockout: ?any;
accountLockout: ?AccountLockoutOptions;
/* Password policy for enforcing password related rules */
passwordPolicy: ?any;
passwordPolicy: ?PasswordPolicyOptions;
/* Adapter module for the cache */
cacheAdapter: ?Adapter<CacheAdapter>;
/* Adapter module for email sending */
@@ -291,3 +291,27 @@ export interface IdempotencyOptions {
:DEFAULT: 300 */
ttl: ?number;
}
export interface AccountLockoutOptions {
/* number of minutes that a locked-out account remains locked out before automatically becoming unlocked. */
duration: ?number;
/* number of failed sign-in attempts that will cause a user account to be locked */
threshold: ?number;
}
export interface PasswordPolicyOptions {
/* a RegExp object or a regex string representing the pattern to enforce */
validatorPattern: ?string;
/* a callback function to be invoked to validate the password */
validatorCallback: ?() => void;
/* disallow username in passwords */
doNotAllowUsername: ?boolean;
/* days for password expiry */
maxPasswordAge: ?number;
/* setting to prevent reuse of previous n passwords */
maxPasswordHistory: ?number;
/* time for token to expire */
resetTokenValidityDuration: ?number;
/* resend token if it's still valid */
resetTokenReuseIfValid: ?boolean;
}