Skip to content

Commit 172586b

Browse files
author
Borovski Cergei
committed
fixed mistakes
1 parent 65c5475 commit 172586b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/mate/academy/security/impl/AuthenticationServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ public User login(String email, String password) throws AuthenticationException
2020
final Optional<User> userFromDbOptional = userService.findByEmail(email);
2121
if (userFromDbOptional.isEmpty()) {
2222
throw new AuthenticationException("The user with email = "
23-
+ email + "does not exist in the database");
23+
+ email + " does not exist in the database");
2424
}
2525
final User user = userFromDbOptional.get();
2626
String hashedPassword = HashUtil.hashPassword(password, user.getSalt());
2727
if (user.getPassword().equals(hashedPassword)) {
2828
return user;
2929
}
30-
throw new AuthenticationException("Password " + password + "is not correct");
30+
throw new AuthenticationException("Password " + password + " is not correct");
3131
}
3232

3333
@Override

src/main/java/mate/academy/util/HashUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static String hashPassword(String password, byte[] salt) {
2727
hashedPassword.append(String.format("%02x", b));
2828
}
2929
} catch (NoSuchAlgorithmException e) {
30-
throw new IllegalStateException("Could`nt create hash using SHA 512 algorithm");
30+
throw new IllegalStateException("Could not create hash using SHA 512 algorithm");
3131
}
3232
return hashedPassword.toString();
3333
}

0 commit comments

Comments
 (0)