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

[IDLE-74] 로그인시 토큰 로컬 저장및 모든 요청에 적용 #18

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

J0onYEong
Copy link
Contributor

@J0onYEong J0onYEong commented Jul 10, 2024

변경사항

  • 특정 요청에 토큰헤더 추가
  • 토큰 만료시 만료된 토큰을 자동으로 refresh하고 요청 재시도
  • 에러처리 로직

JWT토큰

로그인 성공시 JWT토큰이 내부 키체인에 저장됩니다.
토큰 저장로직은 Data레이어의 레포지토리에 존재합니다.
모든 네트워크 서비스가 하나의 KeyStore를 공유하도록 개발할 예정입니다.
아직 KeyChain사용에 대한 Entitlement는 포함하지 않은 상황이라 실제 디바이스에서는 해당 기능에서 에러가 발생합니다.
스크린샷 2024-07-10 오후 4 08 34

에러처리 로직

image

기존에는 로컬에 저장된 토큰을 무조건 사용하는 방향으로 구현하였지만, 토큰이 필요하지 않은 API도 토큰의 만료 여부를 판단합니다. 따라서 토큰을 사용하는 세션과 사용하지 않는 세션을 분리하였습니다.
에러타입 타입명 수정
네트워크 요청시 Moya Provider가 에러를 발생시키지 않는 스테이터스 코드 설정(200, 201, 204, 400), 현재까지 파악된 나머지는 500(서버에러)
@J0onYEong J0onYEong merged commit 67cff3a into develop Jul 11, 2024
1 check passed
@J0onYEong J0onYEong deleted the feature/token branch July 11, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant