-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/53 add volunteer signin signout #62
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
Merged
Merged
Conversation
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
- 리프레시 토큰 삭제의 파라미터를 엑세스 토큰에서 사용자 ID로 변경 - 리프레시 토큰이 존재하지 않아도 로그아웃이 가능하도록 로직 수정 - 리프레시 토큰이 없는 상태에서 로그아웃이 불가능한 것은 비정상적인 동작으로 판단 - 레포지토리에서 사용자 ID로 리프레시 토큰을 찾는 메서드 추가
- 로그아웃 시 액세스 토큰 쿠키를 삭제(덮어씌우기)하는 로직 추가 - 리프레시 토큰을 사용자 ID를 기반으로 삭제하도록 처리
- 액세스 토큰 설정 동작 검증 - 토큰 값, HttpOnly, Secure, Path 등 쿠키 속성 확인 - 액세스 토큰 삭제 동작 검증 - 쿠키 값에 SIGNOUT이 포함된 것을 확인 - 쿠키 값이 삭제(Max-Age=0)되었는지 확인
- OAuth 인증 URL을 동적으로 생성
- 백엔드 Root URL과 OAuth Provider 이름을 조합하여 URL 생성
- /oauth2/authorization/{provider} 형태의 URL 반환 로직 구현
- 환경에 따라 백엔드 Root URL을 설정할 수 있도록 @value("${app.back-url}") 적용
- OAuth Provider에 따라 올바른 URL이 생성되는지 검증
- 테스트 후 레디스 delete all - 액세스 토큰 쿠키 삭제 및 리프레시 토큰 제거 검증 - 리프레시 토큰이 없는 경우에도 예외가 발생하지 않는지 확인 - 테스트 시 MockHttpServletResponse를 활용하여 쿠키 동작 검증 - 쿠키 name이 중복으로 저장되는 문제 회피 (트러블슈팅 기록)
- OAuth 로그인 URL 생성 API 추가
- [POST] /api/volunteer/sign-in/oauth/{oauthProvider}
- 지원되는 OAuth 제공자에 따라 리다이렉트 URL 생성 및 반환
- 지원되지 않는 OAuth 제공자는 `BadRequestException` 처리
- 로그아웃 API 추가
- [POST] /api/volunteer/sign-out
- 액세스 토큰 쿠키 삭제 및 리프레시 토큰 제거
- 성공 시 표준 응답 형식(`ApiResponse.ok`)으로 메시지 반환
- GenerateOAuthUrlUseCase를 사용해 OAuth URL 동적 생성
- SignOutVolunteerUseCase를 사용해 로그아웃 로직 처리
Closed
2 tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빌드에 실패했습니다.
* cicd: 환경변수 추가 - OAuth 연동을 위한 환경변수 추가
- 유효한 OAuth 제공자로 로그인 URL 생성 테스트 추가 - 지원되지 않는 OAuth 제공자에 대해 400 에러 반환 테스트 추가 - 로그아웃 요청 시 성공 메시지 반환 테스트 추가
- 리프레시 토큰 삭제의 파라미터를 엑세스 토큰에서 사용자 ID로 변경 - 리프레시 토큰이 존재하지 않아도 로그아웃이 가능하도록 로직 수정 - 리프레시 토큰이 없는 상태에서 로그아웃이 불가능한 것은 비정상적인 동작으로 판단 - 레포지토리에서 사용자 ID로 리프레시 토큰을 찾는 메서드 추가
- 로그아웃 시 액세스 토큰 쿠키를 삭제(덮어씌우기)하는 로직 추가 - 리프레시 토큰을 사용자 ID를 기반으로 삭제하도록 처리
- 액세스 토큰 설정 동작 검증 - 토큰 값, HttpOnly, Secure, Path 등 쿠키 속성 확인 - 액세스 토큰 삭제 동작 검증 - 쿠키 값에 SIGNOUT이 포함된 것을 확인 - 쿠키 값이 삭제(Max-Age=0)되었는지 확인
- OAuth 인증 URL을 동적으로 생성
- 백엔드 Root URL과 OAuth Provider 이름을 조합하여 URL 생성
- /oauth2/authorization/{provider} 형태의 URL 반환 로직 구현
- 환경에 따라 백엔드 Root URL을 설정할 수 있도록 @value("${app.back-url}") 적용
- OAuth Provider에 따라 올바른 URL이 생성되는지 검증
- 테스트 후 레디스 delete all - 액세스 토큰 쿠키 삭제 및 리프레시 토큰 제거 검증 - 리프레시 토큰이 없는 경우에도 예외가 발생하지 않는지 확인 - 테스트 시 MockHttpServletResponse를 활용하여 쿠키 동작 검증 - 쿠키 name이 중복으로 저장되는 문제 회피 (트러블슈팅 기록)
- OAuth 로그인 URL 생성 API 추가
- [POST] /api/volunteer/sign-in/oauth/{oauthProvider}
- 지원되는 OAuth 제공자에 따라 리다이렉트 URL 생성 및 반환
- 지원되지 않는 OAuth 제공자는 `BadRequestException` 처리
- 로그아웃 API 추가
- [POST] /api/volunteer/sign-out
- 액세스 토큰 쿠키 삭제 및 리프레시 토큰 제거
- 성공 시 표준 응답 형식(`ApiResponse.ok`)으로 메시지 반환
- GenerateOAuthUrlUseCase를 사용해 OAuth URL 동적 생성
- SignOutVolunteerUseCase를 사용해 로그아웃 로직 처리
- 유효한 OAuth 제공자로 로그인 URL 생성 테스트 추가 - 지원되지 않는 OAuth 제공자에 대해 400 에러 반환 테스트 추가 - 로그아웃 요청 시 성공 메시지 반환 테스트 추가
851a2c2 to
0c8bf5c
Compare
…signout' into feature/53-add-volunteer-signin-signout # Conflicts: # src/main/java/com/somemore/volunteer/service/SignOutVolunteerService.java # src/test/java/com/somemore/volunteer/service/SignOutVolunteerServiceTest.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빌드에 실패했습니다.
|
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.



resolved :
📌 과제 설명
봉사자 로그인 및 로그아웃을 처리하는 컨트롤러와 관련 서비스를 구현
👩💻 요구 사항과 구현 내용
봉사자 로그인
/api/volunteer/sign-in/oauth/{oauthProvider}GenerateOAuthUrlService를 사용하여 OAuth URL 생성봉사자 로그아웃
/api/volunteer/sign-outSignOutVolunteerService를 사용하여 로그아웃 로직 처리feat(SignIn): OAuth URL 생성 서비스 구현
GenerateOAuthUrlService추가.application.yml에서 front/back root URL 변수를 사용하여 동적으로 URL 생성.feat(SignOut): 로그아웃 로직 구현
SignOutVolunteerService에서 액세스 토큰 쿠키 삭제 및 리프레시 토큰 제거 로직 처리.feat(cookie): 토큰 타입 추가 (SIGNOUT)
SIGNOUT타입으로 처리.test(CookieService): 액세스 토큰 설정 및 삭제 테스트 추가
test(GenerateOAuthUrlService): OAuth URL 생성 로직 테스트 추가
test(SignOutVolunteerService): 로그아웃 동작 테스트 추가
✅ PR 포인트 & 궁금한 점