Add account unlock on password reset (#7146)
* added account unlock on password reset * added account policy option * added changelog entry * Added docs entry * moved changelog entry to correct position * improved tests to ensure requesting password reset email does not unlock account * run prettier
This commit is contained in:
@@ -9,7 +9,9 @@ import net from 'net';
|
||||
import {
|
||||
IdempotencyOptions,
|
||||
FileUploadOptions,
|
||||
AccountLockoutOptions,
|
||||
} from './Options/Definitions';
|
||||
import { isBoolean } from 'lodash';
|
||||
|
||||
function removeTrailingSlash(str) {
|
||||
if (!str) {
|
||||
@@ -146,6 +148,12 @@ export class Config {
|
||||
) {
|
||||
throw 'Account lockout threshold should be an integer greater than 0 and less than 1000';
|
||||
}
|
||||
|
||||
if (accountLockout.unlockOnPasswordReset === undefined) {
|
||||
accountLockout.unlockOnPasswordReset = AccountLockoutOptions.unlockOnPasswordReset.default;
|
||||
} else if (!isBoolean(accountLockout.unlockOnPasswordReset)) {
|
||||
throw 'Parse Server option accountLockout.unlockOnPasswordReset must be a boolean.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user