Skip to content

Refactor/#48 jwt refresh 토큰 쿠키에 전송 및 swagger ui 변경#49

Merged
seokbeom00 merged 2 commits intodevelopfrom
refactor/#48
Feb 14, 2025
Merged

Refactor/#48 jwt refresh 토큰 쿠키에 전송 및 swagger ui 변경#49
seokbeom00 merged 2 commits intodevelopfrom
refactor/#48

Conversation

@sejoon00
Copy link
Contributor

@sejoon00 sejoon00 commented Feb 13, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

  1. jwt refresh 토큰으로 accessToken을 재발급 하는 reissue api를 추가하였습니다.
  • 로그인이나 토큰 재발급 시 jwt refreshToken이 cookie에 담아서 전송됩니다.
    • http-only, samesite, secure 설정이 되어 있습니다.
    • http-only : XSS 공격 방지
    • samesite, secure : CSRF 공격 방지
  1. swagger ui를 같은 도메인 끼리 묶어 깔끔하게 수정하였습니다.
    image

📝 테스트 사항

image

Copy link
Contributor

@seokbeom00 seokbeom00 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!


TokenResponse tokenResponse = authService.reissueToken(refreshToken);

response.addCookie(cookieUtil.createCookie(tokenResponse.refreshToken()));
Copy link
Contributor

Choose a reason for hiding this comment

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

쿠키 방식은 처음 보는데, 함수가 깔끔하게 존재하는군요. 고생하셨습니다!

@seokbeom00 seokbeom00 merged commit 0a43525 into develop Feb 14, 2025
1 check passed
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.

♻️ jwt 토큰 cookie에 담기 & swagger ui 변경

2 participants

Comments