Skip to content

Commit

Permalink
[Bug] 인가 코드 디코딩 진행 (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
iiqcov authored Nov 14, 2024
1 parent c35ecb1 commit 52d4e2d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package gigedi.dev.domain.auth.application;

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

import org.springframework.security.oauth2.core.oidc.user.OidcUser;
Expand Down Expand Up @@ -36,7 +38,9 @@ public class AuthService {
private final MemberUtil memberUtil;

public TokenPairResponse googleSocialLogin(String code) {
GoogleLoginResponse response = googleService.getIdTokenByGoogleLogin(code);
GoogleLoginResponse response =
googleService.getIdTokenByGoogleLogin(
URLDecoder.decode(code, StandardCharsets.UTF_8));
OidcUser user = idTokenVerifier.getOidcUser(response.getIdToken());
Member member = getOrCreateMember(user);
googleService.saveGoogleRefreshToken(member.getId(), response.getRefreshToken());
Expand Down

0 comments on commit 52d4e2d

Please sign in to comment.