From c2aaab412d30cbf6c81661f0a5828ef197ff0f2a Mon Sep 17 00:00:00 2001 From: huhdy32 Date: Fri, 9 Jan 2026 16:10:53 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor(auth):=20=EC=9D=BC=EA=B4=80?= =?UTF-8?q?=EB=90=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD.=20if=20=EC=A0=88?= =?UTF-8?q?=EC=97=90=EC=84=9C=20throw=20=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=ED=95=98=EC=97=AC=20=EA=B0=80=EB=8F=85=EC=84=B1=20=ED=96=A5?= =?UTF-8?q?=EC=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/auth/service/LoginService.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java b/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java index 5f032cb9..8a22e058 100644 --- a/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java +++ b/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java @@ -45,18 +45,19 @@ public JwtLoginResult login(@NotNull @Valid final LoginCommand command) { throw new MemberLockedException(member.getLockInfo().getRemainLockDuration(now)); } - // 비밀번호 일치 - if (isMatch(command.password(), member.getPassword())) { - member.getLockInfo().unlock(); - log.info("[LoginService.login] member login success: {}", member.getId()); - return jwtLoginManager.login(member.getId(), member.getRole(), member.getName()); + // 비밀번호 불일치 + if (!isMatch(command.password(), member.getPassword())) { + // 비밀번호 불일치 + member.getLockInfo().addFailedCount(now); + memberRepository.save(member); + log.warn("[LoginService.login] password not matched for member: {}, remain try count: {}", member.getId(), + member.getLockInfo().getRemainTryCount()); + throw new PasswordMismatchedException(member.getLockInfo().getRemainTryCount()); } - // 비밀번호 불일치 - member.getLockInfo().addFailedCount(now); - memberRepository.save(member); - log.warn("[LoginService.login] password not matched for member: {}, remain try count: {}", member.getId(), member.getLockInfo().getRemainTryCount()); - throw new PasswordMismatchedException(member.getLockInfo().getRemainTryCount()); + member.getLockInfo().unlock(); + log.info("[LoginService.login] member login success: {}", member.getId()); + return jwtLoginManager.login(member.getId(), member.getRole(), member.getName()); } public JwtLoginResult refresh(@NotNull final String refreshToken) { From a0d1275ec4a0bdad3b855275eb641daa63194958 Mon Sep 17 00:00:00 2001 From: huhdy32 Date: Fri, 9 Jan 2026 16:16:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?style(auth):=20=EC=A4=91=EB=B3=B5=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kr/co/mathrank/domain/auth/service/LoginService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java b/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java index 8a22e058..b64bbf89 100644 --- a/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java +++ b/domain/mathrank-auth-domain/src/main/java/kr/co/mathrank/domain/auth/service/LoginService.java @@ -47,7 +47,6 @@ public JwtLoginResult login(@NotNull @Valid final LoginCommand command) { // 비밀번호 불일치 if (!isMatch(command.password(), member.getPassword())) { - // 비밀번호 불일치 member.getLockInfo().addFailedCount(now); memberRepository.save(member); log.warn("[LoginService.login] password not matched for member: {}, remain try count: {}", member.getId(),