Skip to content

Commit 29b0223

Browse files
committed
fix: SigInResource
1 parent fc016fc commit 29b0223

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

timeless-api/src/main/java/dev/matheuscruz/presentation/SignInResource.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ public Response signIn(@Valid SignInRequest req) {
4747
if (userOptional.isPresent()) {
4848
user = userOptional.get();
4949
} else {
50-
// try to find by plain text
50+
5151
try {
5252
user = (User) entityManager.createNativeQuery("SELECT * FROM users WHERE email = :email", User.class)
5353
.setParameter("email", req.email()).getSingleResult();
54-
55-
// if found, we need to migrate the user to the new encryption format
56-
// but first we need to check the password
54+
5755
Boolean checked = BCryptAdapter.checkPassword(req.password(), user.getPassword());
5856

5957
if (!checked) {

0 commit comments

Comments
 (0)