Skip to content

Commit

Permalink
feat: 로그인 로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
daeunkwak committed Sep 17, 2023
1 parent 1e1b6bb commit cdb0920
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import app.gangdan.please.domain.member.constant.SocialType;
import app.gangdan.please.dto.member.jwt.ResponseJwtTokenDto;
import app.gangdan.please.global.exception.BadRequestException;
import org.apache.commons.lang3.EnumUtils;
import app.gangdan.please.service.oauth.OauthLoginService;
import io.swagger.v3.oas.annotations.Operation;
Expand Down Expand Up @@ -39,7 +40,13 @@ public ResponseEntity<ResponseJwtTokenDto> loginOauth(HttpServletRequest httpSer

final SocialType socialType = SocialType.GOOGLE;

final ResponseJwtTokenDto jwtTokenDto = oauthLoginService.googleLoginV2(httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION));
final String tokenString = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION);

if (tokenString == null || tokenString.isEmpty()) {
throw new BadRequestException("토큰이 없습니다.");
}

final ResponseJwtTokenDto jwtTokenDto = oauthLoginService.googleLoginV2(tokenString);

log.info("=== Oauth login end ===");
return ResponseEntity.ok(jwtTokenDto);
Expand Down

0 comments on commit cdb0920

Please sign in to comment.