Skip to content

Commit

Permalink
[fix] 네이버 로그인 문제로 인한 로그 추가 (#11)
Browse files Browse the repository at this point in the history
* #4 fix: 인가 코드 요청 URL 경로 변경

- /api/auth/:provider/url -> /api/auth/:provider/authUrl

* #4 feat: 로그 추가

- 네이버 소셜 로그인 버그를 위한 로그 추가
  • Loading branch information
yonghwankim-dev authored Nov 13, 2023
1 parent 2c8a8ec commit ed2eb20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public ApiResponse<OauthMemberLoginResponse> login(
@RequestParam final String code,
@RequestParam final String redirectUrl,
@RequestParam final String state) {
log.info("로그인 컨트롤러 요청 : provider = {}, code = {}, redirectUrl = {}, state = {}", provider, code, redirectUrl,
state);
return ApiResponse.success(OauthSuccessCode.OK_LOGIN,
memberService.login(provider, code, redirectUrl, state, LocalDateTime.now()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public class MemberService {

public OauthMemberLoginResponse login(String provider, String code, String redirectUrl, String state,
LocalDateTime now) {
log.info("로그인 서비스 요청 : provider = {}, code = {}, redirectUrl = {}, state = {}", provider, code, redirectUrl,
state);
AuthorizationRequest request = getCodeVerifier(state);
OauthUserProfileResponse profileResponse = getOauthUserProfileResponse(provider, code, redirectUrl, request,
now, state);
Expand All @@ -69,6 +71,8 @@ public OauthMemberLoginResponse login(String provider, String code, String redir
}

private AuthorizationRequest getCodeVerifier(String state) {
log.info("AuthorizationRequest 조회 : state={}", state);
log.info("authorizationRequestMap : {}", authorizationRequestMap);
AuthorizationRequest request = authorizationRequestMap.remove(state);
if (request == null) {
throw new BadRequestException(OauthErrorCode.WRONG_STATE);
Expand Down

0 comments on commit ed2eb20

Please sign in to comment.