Skip to content

Commit

Permalink
fix(Login): OTP 활성 정보가 없는 경우 비활성으로 간주하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee committed May 13, 2024
1 parent b42f196 commit c6be78d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import page.clab.api.global.util.HttpReqResUtil;

import java.util.List;
import java.util.Optional;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit c6be78d

Please sign in to comment.