This commit is contained in:
Mohamed Karray
2018-09-20 12:57:01 +02:00
parent 2683dd651b
commit 484d5c68c8
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ package sonia.scm.user;
public class InvalidPasswordException extends RuntimeException { 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) { public InvalidPasswordException(String message) {
super(message); super(message);

View File

@@ -24,7 +24,7 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.UriInfo;
import java.util.function.Consumer; 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) { private Consumer<User> getOldOriginalPasswordChecker(String oldPassword) {
return user -> { return user -> {
if (!user.getPassword().equals(passwordService.encryptPassword(oldPassword))) { if (!user.getPassword().equals(passwordService.encryptPassword(oldPassword))) {
throw new InvalidPasswordException(PWD_NOT_MATCHED); throw new InvalidPasswordException(INVALID_MATCHING);
} }
}; };
} }