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

[BE-55] feat : 토큰을 쿠키에 담아서 보내기 #167

Merged
merged 3 commits into from
Feb 25, 2024
Merged

Conversation

LJH098
Copy link
Contributor

@LJH098 LJH098 commented Feb 24, 2024

개요

close #166

작업사항

  • Access / Refresh Token을 Cookie 담아서 repsonse로 보내주었습니다.

변경로직

Cookie accessCookie = new Cookie("ACCESS_TOKEN", tokenResponse.getAccessToken());
        accessCookie.setHttpOnly(true);
        accessCookie.setPath("/");
        accessCookie.setMaxAge(60 * 60 * 24 * 30);
        response.addCookie(accessCookie);

        Cookie refreshCookie = new Cookie("REFRESH_TOKEN", tokenResponse.getRefreshToken());
        refreshCookie.setHttpOnly(true);
        refreshCookie.setPath("/");
        refreshCookie.setMaxAge(60 * 60 * 24 * 30);
        response.addCookie(refreshCookie);

reference

- 엑세스 / 리프레쉬 토큰을 쿠키에 굽기
@LJH098 LJH098 added the feature✨ This issue or pull request already exists label Feb 24, 2024
@LJH098 LJH098 self-assigned this Feb 24, 2024
Copy link
Collaborator

@BlackBean99 BlackBean99 left a comment

Choose a reason for hiding this comment

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

Reject

Comment on lines 63 to 66
accessCookie.setHttpOnly(true);
accessCookie.setPath("/");
accessCookie.setMaxAge(60 * 60 * 24 * 30);
response.addCookie(accessCookie);
Copy link
Collaborator

Choose a reason for hiding this comment

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

중복 로직이 있으니 refactor 하는 것은 어떻게 생각하시나요?

@LJH098 LJH098 merged commit 799f00a into backend Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature✨ This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants