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

인증/인가 파트 리팩토링 #52

Merged
merged 14 commits into from
Mar 31, 2024
Merged

인증/인가 파트 리팩토링 #52

merged 14 commits into from
Mar 31, 2024

Conversation

strangehoon
Copy link
Member

📕 연관 이슈 번호

#45

📙 작업 내용

구현 내용 및 작업 했던 내용
저번에 회의 시간에 공유했던 내용 리팩토링

  • refresh token을 쿠키에 저장
  • 불필요한 로직 제거

📗 논의 사항

PR을 볼 때 주의깊게 봐야하거나 말하고 싶은 점

  • 인증/인가 파트 리팩토링으로 인하여 몇몇 테스트 @disabled 처리
  • 다음 pr : 전체 api + 테스트코드 리팩토링

📘 체크리스트

  • [o] 본인을 Assign해주시고, 본인을 제외한 백엔드 개발자를 Reviewer로 지정해주세요.
  • [o] 라벨 체크해주세요.
  • [o] .yml 파일 수정 내용이 있다면 공유해주세요.

@strangehoon strangehoon added the 💡Refactor 리팩토링, 성능개선 등 label Mar 30, 2024
@strangehoon strangehoon self-assigned this Mar 30, 2024
Copy link

github-actions bot commented Mar 30, 2024

Test Results

 79 files   79 suites   6s ⏱️
114 tests 107 ✅ 7 💤 0 ❌
115 runs  108 ✅ 7 💤 0 ❌

Results for commit 5ef30e0.

♻️ This comment has been updated with latest results.

Copy link
Member

@woo0doo woo0doo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

public ApiResponse<TokensResponseDto> loginKakao(@RequestParam String code, HttpServletResponse response) throws JsonProcessingException {
Token tokens = kakaoService.loginKakao(code);
ResponseCookie cookie = ResponseCookie.from(REFRESH_TOKEN, tokens.refreshToken())
.maxAge(60*60*24*7)
Copy link
Member

Choose a reason for hiding this comment

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

이러면 7일동안만 쿠키에 보관되는건가요??

Copy link
Member Author

Choose a reason for hiding this comment

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

넵넵 맞습니다!!

private final static String REFRESH_TOKEN = "refreshToken";

@PostMapping("/signup")
public ApiResponse<TokensResponseDto> signUpUser(@RequestBody @Valid SignUpRequestDto signUpRequestDto, HttpServletResponse response) {
Token tokens = userService.signUpUser(signUpRequestDto);
ResponseCookie cookie = ResponseCookie.from(REFRESH_TOKEN, tokens.refreshToken())
.maxAge(REFRESH_TOKEN_EXPIRE_TIME)
.maxAge(60*60*24*7)
Copy link
Member

Choose a reason for hiding this comment

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

이것때문에 오류났던 거였나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

네 이것 때문에 ㅠㅠ.. 로컬에서는 정상 작동하는데..

@strangehoon strangehoon merged commit e6114c3 into develop Mar 31, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡Refactor 리팩토링, 성능개선 등
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants