Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Google Login 구현 변경 #172

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ class AuthController(
private val googleAuthService: GoogleAuthService,
private val kaKaoAuthService: KaKaoAuthService,
) {
@Value("\${GOOGLE_CLIENT_ID}")
lateinit var clientId: String

@Value("\${REDIRECT_URI}")
lateinit var redirectUri: String

@Value("\${KAKAO_REST_API_KEY}")
lateinit var kakaokey: String

Expand All @@ -34,18 +28,7 @@ class AuthController(

@Operation(summary = "google-login", description = "구글 로그인/회원가입")
@GetMapping("/google-login")
fun googleLogin(): RedirectView {
val redirectView = RedirectView()
redirectView.url =
"https://accounts.google.com/o/oauth2/v2/auth?client_id=$clientId&" +
"response_type=code&redirect_uri=$redirectUri&scope=https://www.googleapis.com/auth/userinfo.email"

return redirectView
}

@Operation(summary = "google user info", description = "구글 로그인 유저 정보 조회")
@GetMapping("/token")
fun getUserInfo(
fun googleLogin(
@RequestParam code: String,
): BaseResponse<UserInfoResponse> {
val accessToken = googleAuthService.getTokenFromGoogle(code)
Expand Down
Loading