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

[Refactoring] RefreshToken 자동갱신 #109

Open
1 of 4 tasks
siyooonkim opened this issue Aug 18, 2021 · 2 comments
Open
1 of 4 tasks

[Refactoring] RefreshToken 자동갱신 #109

siyooonkim opened this issue Aug 18, 2021 · 2 comments
Assignees

Comments

@siyooonkim
Copy link
Collaborator

ISSUE

  • Type:
  1. Error Handling
  2. Enhancement
  3. Add new feature
  • Detail:
  1. 현재상황 :
  • accessToken이 만료되면 refreshToken을 요청하는 구조
  1. 작업방향 :
  • 토큰 시간이 만료되면 자동 갱신요청
  • expire 시간 계산시 moment.js가 아닌 day.js 사용예정
  • axios Interceptor 활용예정 (axios defaults주소 전역적용을위해 석준님께서 작성하셨던 axiosConfig파일에 추가예정)
  • 현재 refreshToken이 local에서는 확인되지 않아, 주소변경하여 테스트필요

Work

  1. RefreshToken 자동갱신
@siyooonkim siyooonkim self-assigned this Aug 18, 2021
@siyooonkim
Copy link
Collaborator Author

siyooonkim commented Aug 20, 2021

특이사항

  • Access Token 자동 갱신(80% 진행)
  • moment.js => day.js 변경
  • axiosConfig 파일에 axios default configuration과 함께 적용
  • getExplore actions에 테스트 적용한 상태 ( _axios )

Check Point

  • 로그인 성공시 Cookie에서 refreshToken을 확인 수 없음
  • 이후 토큰갱신 요청시에도 refreshToken을 별도로 보내지 않기 때문에, 401 에러 반환 => 로그아웃처리
  • 유빈님 시간 될때 확인 필요

@siyooonkim
Copy link
Collaborator Author

  • 기존 로직 : 로그인 성공 => getBookmark요청 (CollectPage)
  • getBookmark요청시 axiosConfig에서 했던 설정이 적용됨 (토큰 자동갱신)
  • 토큰 자동갱신 요청시에는 cookie에 있는 refreshToken을 함께 보내야함
  • 하지만, 최초 로그인 성공시 Cookie에서 refreshToken을 확인 수 없음
  • 이후 토큰갱신 요청시에도 refreshToken을 별도로 보내지 않기 때문에, 401 에러 반환
  • catch문에서 로그아웃처리

저희도 refreshToken을 쿠키에서 확인할수 없는 이유를 찾아보면 좋을 것 같습니다.
그리고 유빈님 여유 생기실때 함께 확인해보면 좋을것같습니다.
refreshToken문제가 해결되기 전까지,
axiosConfig파일에서 자동갱신 부분은 임시적으로 주석처리하고 진행하면 좋을것 같네요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant