Skip to content

Commit

Permalink
Merge branch 'feature/ISSUE-56' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stopmin committed Jul 18, 2024
2 parents 061cef2 + 083e9ee commit b3a5a9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

Expand Down Expand Up @@ -38,7 +39,16 @@ public ResponseEntity<?> kakaoOauthCallback(@RequestParam String code) {
return ResponseEntity
.ok()
.body(new CommonResponse<>(
kakaoOauthService.processKakaoLogin(code), "카카오 로그인 성공", true
kakaoOauthService.processKakaoLoginAndGenerateAccessToken(code), "카카오 로그인 성공", true
));
}

@PostMapping("/login/ok")
public ResponseEntity<?> loginOk(@RequestParam String code) {
return ResponseEntity
.ok()
.body(new CommonResponse<>(
kakaoOauthService.processKakaoLoginAndGenerateAccessToken(code), "카카오 로그인 성공", true
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void getKakaoLogout(String accessToken) {
.body(KakaoProfile.class);
}

public TokenResponse processKakaoLogin(String code) {
public TokenResponse processKakaoLoginAndGenerateAccessToken(String code) {
// 1. 카카오에서 액세스 토큰 획득
KakaoLoginResponseDTO tokenResponse = getKakaoAccessToken(code);
String accessToken = tokenResponse.getAccessToken();
Expand Down

0 comments on commit b3a5a9f

Please sign in to comment.