Compare commits
2 Commits
develop
...
code-clean
Author | SHA1 | Date | |
---|---|---|---|
875a4fc458 | |||
ec0dc30709 |
@ -51,7 +51,10 @@
|
||||
validity_period: 20,
|
||||
},
|
||||
auth: {
|
||||
approval_mode: false, // Registered accounts need to be approved by an administrator
|
||||
name_change_wait_period: 2592000000, // 30 days
|
||||
// If true, registered accounts need to be approved by an administrator
|
||||
approval_mode: false,
|
||||
|
||||
// 30 days
|
||||
name_change_wait_period: 2592000000,
|
||||
},
|
||||
}
|
||||
|
@ -91,11 +91,11 @@ export default class AccountController extends Controller {
|
||||
}
|
||||
|
||||
protected async postChangePassword(req: Request, res: Response): Promise<void> {
|
||||
const validationMap = {
|
||||
await Validator.validate({
|
||||
'new_password': new Validator().defined(),
|
||||
'new_password_confirmation': new Validator().sameAs('new_password', req.body.new_password),
|
||||
};
|
||||
await Validator.validate(validationMap, req.body);
|
||||
}, req.body);
|
||||
|
||||
const user = req.as(RequireAuthMiddleware).getUser();
|
||||
const passwordComponent = user.as(UserPasswordComponent);
|
||||
if (passwordComponent.hasPassword() && !await passwordComponent.verifyPassword(req.body.current_password)) {
|
||||
|
Loading…
Reference in New Issue
Block a user