Skip to content

Conversation

@ChaeAg
Copy link
Member

@ChaeAg ChaeAg commented Nov 6, 2024

Related Issue

Key Changes

애플에서 따로 제공하는 로그아웃 API가 없어서 서비스 자체 로그아웃 기능을 구현했습니다.

구 방법

구 방법
1. 헤더에 액세스 토큰, 바디에 리프레시 토큰을 담아서 로그아웃 API가 호출됩니다.
2. redis에서 해당 유저의 리프레시 토큰을 제거하고, 액세스 토큰을 더 이상 사용하지 못하도록 redis에 저장합니다.
-> 이 때, redis에 해당 액세스 토큰의 남은 유효시간만큼 저장돼있다가 후에는 삭제되도록 했습니다.
3. 사용자 인증이 필요한 API 호출 시 토큰 검증 필터에서 2번에서 저장된 액세스 토큰이 redis에 있는지 검사하고, 있다면 사용하지 못하도록 에러를 발생시킵니다.

New 방법
1. 헤더에 액세스 토큰, 바디에 리프레시 토큰을 담아서 로그아웃 API가 호출됩니다.
2. redis에서 해당 유저의 리프레시 토큰을 제거하여, 액세스 및 리프레시 토큰 재발급을 방지합니다.

To Reviewers

References

https://un-lazy-midnight.tistory.com/160
Jwt 방식 로그아웃 + 조금의 stateful

Copy link
Member

@rinarina0429 rinarina0429 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미 있는 리뷰 말고는 남길게 없는 것 같네요! 수고하셨습니다~~ 수정하고 리뷰 한번만 더 요청해주세요오

@Kim-TaeUk Kim-TaeUk merged commit 48b9d1f into dev Nov 11, 2024
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.

[FEAT] 애플 소셜 로그인 유저 로그아웃 기능 구현

4 participants