mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
review
This commit is contained in:
@@ -2,7 +2,7 @@ package sonia.scm.user;
|
||||
|
||||
public class InvalidPasswordException extends RuntimeException {
|
||||
|
||||
public static final String PWD_NOT_MATCHED = "The given Password does not match with the stored one.";
|
||||
public static final String INVALID_MATCHING = "The given Password does not match with the stored one.";
|
||||
|
||||
public InvalidPasswordException(String message) {
|
||||
super(message);
|
||||
|
||||
@@ -24,7 +24,7 @@ import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static sonia.scm.user.InvalidPasswordException.PWD_NOT_MATCHED;
|
||||
import static sonia.scm.user.InvalidPasswordException.INVALID_MATCHING;
|
||||
|
||||
|
||||
/**
|
||||
@@ -89,7 +89,7 @@ public class MeResource {
|
||||
private Consumer<User> getOldOriginalPasswordChecker(String oldPassword) {
|
||||
return user -> {
|
||||
if (!user.getPassword().equals(passwordService.encryptPassword(oldPassword))) {
|
||||
throw new InvalidPasswordException(PWD_NOT_MATCHED);
|
||||
throw new InvalidPasswordException(INVALID_MATCHING);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user