[KEYCLOAK-405] - Feature that doesn't allow old password to be reused
This commit is contained in:
1 parent
375d061f58
commit
e3bb61248a
19 files changed
+551
-97
No files matched your search
@@ -657,6 +657,8 @@ public class UsersResource {
|
||||
UserCredentialModel cred = RepresentationToModel.convertCredential(pass);
|
||||
try {
|
||||
session.users().updateCredential(realm, user, cred);
|
||||
} catch (IllegalStateException ise) {
|
||||
throw new BadRequestException("Resetting to N old passwords is not allowed.");
|
||||
} catch (ModelReadOnlyException mre) {
|
||||
throw new BadRequestException("Can't reset password as account is read only");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user