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

[REFACTOR] 데이터 레이어 다른 계층 참조하지 않도록 순수하게 개선 #339

Open
9 tasks done
sxunea opened this issue Mar 14, 2024 · 0 comments
Open
9 tasks done
Assignees
Labels
REFACTOR 🧹 코드 리팩토링 혜선 🐱 혜선 담당

Comments

@sxunea
Copy link
Collaborator

sxunea commented Mar 14, 2024

💡 Issue

  • 데이터 레이어가 다른 레이어를 참조하지 않도록 변경해 개선합니다

AS - IS

TokenAuthenticator

  • 액세스 토큰 만료 시, 리프레시 토큰을 통해 재발급 받아야 함
  • 이때 getRefreshToken
    • 성공시
      - 발급된 액세스, 리프레시 prefrenceManager에 저장
    • 실패시 (리프레시도 만료라는 것 → 자동로그인 풀리고 로그인으로 넘어가야 함)
      - 이때, data 레이어의 authenticator에 로그인액티비티. 즉 presentation 레이어를 참조하고있음

TO - BE

AuthInterceptor

  • 인터셉터, prefrenceManager 로 토큰 관리 로직 또한 한번에 해결
  • 리프레시 또한 만료이면 preference의 AccessToken 값에 빈 문자열 저장
  • 로그인 시 AccessToken이 빈 값이면 토스트 띄우고 재로그인 시키도록 해 data 레이어의 presentation 참조 제거

📝 todo

  • Authenticator가 refresh Token 만료시 presentation 레이어를 참조하는 코드를 제거
  • AuthInterceptor에서 다음과 같은 것들을 관리 할 수 있도록
    • 헤더 부착
    • 액세스 토큰, 리프레시 토큰 관리
    • 액세스 토큰 만료 시 처리
    • 리프레시 토큰 만료 시 처리
  • presentation 레이어에서 만료 시 화면 이동을 수행할 수 있도록 구현
    • 토큰 만료
    • 탈퇴, 로그아웃, 방문자 모드까지 기존 플로우대로 정상적인지 확인
@sxunea sxunea added REFACTOR 🧹 코드 리팩토링 혜선 🐱 혜선 담당 labels Mar 14, 2024
@sxunea sxunea self-assigned this Mar 14, 2024
sxunea added a commit that referenced this issue Mar 14, 2024
- 액세스 토큰 만료 됐을 때의 처리
- 리프레시 토큰 만료 됐을 때의 처리
sxunea added a commit that referenced this issue Mar 14, 2024
sxunea added a commit that referenced this issue Mar 24, 2024
sxunea added a commit that referenced this issue Mar 24, 2024
sxunea added a commit that referenced this issue Mar 24, 2024
sxunea added a commit that referenced this issue Mar 27, 2024
sxunea added a commit that referenced this issue Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REFACTOR 🧹 코드 리팩토링 혜선 🐱 혜선 담당
Projects
None yet
Development

No branches or pull requests

1 participant