Skip to content

Commit

Permalink
fix : 구글 로그인이 진행되지 않던 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
1000kkannoo committed Sep 15, 2023
1 parent 195251c commit 6197184
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;

import static com.moim.backend.global.common.Result.INVALID_ACCESS_INFO;
import static com.moim.backend.global.common.Result.NOT_AUTHENTICATE_NAVER_TOKEN_INFO;

Expand Down Expand Up @@ -45,9 +48,11 @@ public Users toEntityUser(String code, Platform platform) {
// Google AccessToken 응답
private String toRequestAccessToken(String code) {
// 발급받은 code -> POST 요청
String decode = URLDecoder.decode(code, StandardCharsets.UTF_8);

ResponseEntity<GoogleTokenResponse> response = restTemplate.postForEntity(
googleProperties.getRequestTokenUri(),
googleProperties.getRequestParameter(code),
googleProperties.getRequestParameter(decode),
GoogleTokenResponse.class
);

Expand Down

0 comments on commit 6197184

Please sign in to comment.