From c6be78db00d0ba1e9b72327ad8a86f18d3c415f1 Mon Sep 17 00:00:00 2001 From: limehee Date: Mon, 13 May 2024 16:12:46 +0900 Subject: [PATCH] =?UTF-8?q?fix(Login):=20OTP=20=ED=99=9C=EC=84=B1=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=EA=B0=80=20=EC=97=86=EB=8A=94=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EB=B9=84=ED=99=9C=EC=84=B1=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EA=B0=84=EC=A3=BC=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../page/clab/api/domain/login/application/LoginService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/page/clab/api/domain/login/application/LoginService.java b/src/main/java/page/clab/api/domain/login/application/LoginService.java index 2a26e70fc..e076d494a 100644 --- a/src/main/java/page/clab/api/domain/login/application/LoginService.java +++ b/src/main/java/page/clab/api/domain/login/application/LoginService.java @@ -29,6 +29,7 @@ import page.clab.api.global.util.HttpReqResUtil; import java.util.List; +import java.util.Optional; @Service @RequiredArgsConstructor @@ -125,7 +126,8 @@ private void logLoginAttempt(HttpServletRequest request, String memberId, boolea private LoginResult generateLoginResult(Member loginMember) { String memberId = loginMember.getId(); String header; - if (loginMember.getIsOtpEnabled() || loginMember.isAdminRole()) { + boolean isOtpEnabled = Optional.ofNullable(loginMember.getIsOtpEnabled()).orElse(false); + if (isOtpEnabled || loginMember.isAdminRole()) { if (!authenticatorService.isAuthenticatorExist(memberId)) { String secretKey = authenticatorService.generateSecretKey(memberId); header = LoginHeader.create(secretKey).toJson();