Skip to content

Commit

Permalink
fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
s39f4lt committed Jan 6, 2021
1 parent eb80d5d commit ab33b20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public class UserController {
String hash = request.params("hash");
userService.updatePassword(hash);
response.status(Response.GET.getStatus());
return "";
return "Password edited";
};

public static Route getMatcha = (request, response) -> {
Expand Down Expand Up @@ -194,7 +194,7 @@ public class UserController {
String hash = request.params("hash");
userService.verified(hash);
response.status(Response.GET.getStatus());
return "";
return "Profile verified";
};

public static Route addToBlackList = (request, response) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ public List<User> getMatcha(Long id) {
public Long createUser(User user) {
checkAllDataForNewUser(user);
String username = user.getUsername();
String email = user.getEmail();
try {
getUserByUsername(username);
throw new MatchaException("User with username already exist");
} catch (NotFoundException ignored) {}
try {
getUserByEmail(email);
throw new MatchaException("User with email already exist");
} catch (NotFoundException ignored) {}
try {
try {
user.setPassword(PasswordCipher.generateStrongPasswordHash(user.getPassword()));
Expand Down

0 comments on commit ab33b20

Please sign in to comment.