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();