fix: RefreshError시 로그인 요청 응답 추가#22
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
자동 생성된 에러 수정 PR
에러 정보
RefreshError근본 원인
사용자의 Google 인증 정보에서 refresh token이 더 이상 유효하지 않거나 만료된 상태입니다. 이로 인해 새 토큰을 가져올 수 없는 문제가 발생했습니다.
AI 분석
에러 메시지는 주로 Google OAuth 2.0 인증 과정에서 발생합니다. 이는 액세스 토큰이 만료됐거나 취소되었을 때 발생할 수 있습니다. 문제는 'get_google_user' 함수에서 credentials.expired 상태일 때 토큰 갱신을 시도하지만, 이 과정에서 문제가 발생하면서 RefreshError가 발생합니다.
수정 내용
Google OAuth 2.0의 RefreshError 발생 시, 사용자에게 새로 로그인하도록 안내 메시지를 반환하십시오. 이를 위해 'get_google_user' 함수에서 RefreshError를 처리하여 적절한 HTTP 응답을 제공합니다.
수정된 파일
backend/app/auth/dependencies.pybackend/app/auth/dependencies.py변경 diff
backend/app/auth/dependencies.py