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.
intro 화면에서 카카오 측에서 accessToken의 유효성을 검사하기 이전에 accessToken을 앱에서 저장하고 있는지 검사하는 로직 추가
로그인을 수행할때, 카카오 로그인 진행 후(accessToken 발급), 서버 로그인 진행시, timeout 에러가 발생하여 제대로 로그인이 진행되지 않는 경우, 앱에 저장된 토큰(accessToken, uuid)를 모두 제거
다시 앱에 진입할 경우, 카카오측에선 accessToken을 발급했고, 이 토큰이 유효하기 때문에 자동 로그인이 되어 홈화면으로 넘어가는 문제 발생 -> 이때 유저정보 api 와 같은 헤더에 accessToken을 필요로 하는 api를 호출하게 될 경우, 앱내에 저장된 accessToken이 존재하지 않기 때문에 문제 발생
따라서 앱내에 accessToken 이 정상적으로 저장되어있고, 이 토큰이 유효할때에만 자동로그인이 되도록 로직 변경
한계: 토큰의 유효성을 검사할때는 앱내에 저장된 토큰을 통해 하는 것이 아니라, AuthApiClient.instance.hasToken, AuthApiClient.instance.accessTokenInfo 와 같은 함수를 통해 진행하는 것이기에, SSOT 원칙의 위배되는감이 없지 않아 있음...
그리고 이렇게 클라에서 토큰에 대한 유효성을 검사해도 현재 유저정보 API(/me)를 호출할 때, 문제가 서버관련 에러가 발생함(클라에선 500, 서버에러는 401) 결국에는 서버에서도 카카오측에 통신을 할때 토큰의 유효성 검사를 하는 것을 알 수 있음.
해결: 토큰의 유효성 검사 자체를 서버에 위임하는게 SSOT 원칙에 들어맞으므로 그게 더 적절한 방법일 것 같음