MCPcopy Index your code
hub / github.com/parse-community/parse-server / validateAccountLockoutPolicy

Method validateAccountLockoutPolicy

src/Config.js:395–419  ·  view source on GitHub ↗
(accountLockout)

Source from the content-addressed store, hash-verified

393 }
394
395 static validateAccountLockoutPolicy(accountLockout) {
396 if (accountLockout) {
397 if (
398 typeof accountLockout.duration !== 'number' ||
399 accountLockout.duration <= 0 ||
400 accountLockout.duration > 99999
401 ) {
402 throw 'Account lockout duration should be greater than 0 and less than 100000';
403 }
404
405 if (
406 !Number.isInteger(accountLockout.threshold) ||
407 accountLockout.threshold < 1 ||
408 accountLockout.threshold > 999
409 ) {
410 throw 'Account lockout threshold should be an integer greater than 0 and less than 1000';
411 }
412
413 if (accountLockout.unlockOnPasswordReset === undefined) {
414 accountLockout.unlockOnPasswordReset = AccountLockoutOptions.unlockOnPasswordReset.default;
415 } else if (!isBoolean(accountLockout.unlockOnPasswordReset)) {
416 throw 'Parse Server option accountLockout.unlockOnPasswordReset must be a boolean.';
417 }
418 }
419 }
420
421 static validatePasswordPolicy(passwordPolicy) {
422 if (passwordPolicy) {

Callers 1

validateOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected