account service checks that password is at least 8 characters
This commit is contained in:
parent
b585e0f105
commit
99653fe40d
@ -117,6 +117,7 @@ public class CoreAccountService {
|
|||||||
public void changePassword(String oldPassword, String newPassword) {
|
public void changePassword(String oldPassword, String newPassword) {
|
||||||
if (!isAccountOpen()) throw new IllegalStateException("Cannot change password on unopened account");
|
if (!isAccountOpen()) throw new IllegalStateException("Cannot change password on unopened account");
|
||||||
if (!StringUtils.equals(this.password, oldPassword)) throw new IllegalStateException("Incorrect password");
|
if (!StringUtils.equals(this.password, oldPassword)) throw new IllegalStateException("Incorrect password");
|
||||||
|
if (newPassword != null && newPassword.length() < 8) throw new IllegalStateException("Password must be at least 8 characters");
|
||||||
keyStorage.saveKeyRing(keyRing, oldPassword, newPassword);
|
keyStorage.saveKeyRing(keyRing, oldPassword, newPassword);
|
||||||
this.password = newPassword;
|
this.password = newPassword;
|
||||||
synchronized (listeners) {
|
synchronized (listeners) {
|
||||||
|
Loading…
Reference in New Issue
Block a user