Conversation
- TokenBlacklist 엔티티 및 Repository 생성 - LogoutFilter를 통한 로그아웃 처리 구현 - SecurityConfig에 로그아웃 설정 추가 - JWTFilter에 블랙리스트 토큰 검증 로직 추가 Resolves: #38
KIM9909
reviewed
Dec 16, 2024
Contributor
KIM9909
left a comment
There was a problem hiding this comment.
로그아웃 시 토큰을 블랙리스트에 넣는 이유가 있나요 ?
Contributor
Author
@KIM9909 |
LeeGukgeon
reviewed
Dec 16, 2024
Contributor
LeeGukgeon
left a comment
There was a problem hiding this comment.
장고처럼 딸깍해서 되는게 아니었네요 로그아웃 기능 구현 확인했습니다
Contributor
|
yml에 토큰 만료 시간도 설정하면 더 좋을 것 같습니다 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📋 요약
🛠 변경 사항
🔗 관련 이슈
📸 스크린샷 또는 GIF (해당되는 경우)
로그아웃

로그인 시 받은 토큰을 가지고 로그아웃을 합니다.
tbl_token_blacklist

그럼 해당 토큰은 블랙리스트에 등록이 됩니다.
특정 경로 요청

특정 경로에 요청을 보내면, 401 에러(인증되지 않음)를 받습니다.
✅ 체크리스트
🛡 테스트 방법
.
📚 추가 참고 사항
로그아웃 시 토큰을 블랙리스트에 등록하는 방법으로는 DB를 이용하거나 Redis를 이용하는 것이 있습니다.
저는 일단 DB를 이용했는데, Redis가 속도도 빠르고 자동 만료 기능 등이 있다고 하더라구요. 나중에 Redis를 사용하는 것으로 코드 리팩토링 해보겠습니다..!