-
Notifications
You must be signed in to change notification settings - Fork 6
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] 토큰 확인하는 API를 구현한다. #767
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b28777c
fix: @Param 어노테이션 추가
JINU-CHANG dbd6f2b
feat: 리프레시 토큰 확인하는 API 구현
JINU-CHANG 856e394
refactor: CookieResolver 클래스 코드 리팩토링
JINU-CHANG 05fb9c8
style: 공백 제거
JINU-CHANG c486505
style: URI 변경
JINU-CHANG 0d3cfb9
style: 메서드 네이밍 변경
JINU-CHANG 692184f
style: DisplayName 수정
JINU-CHANG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
8 changes: 8 additions & 0 deletions
8
.../bang-ggood/src/main/java/com/bang_ggood/auth/dto/response/RefreshTokenCheckResponse.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.bang_ggood.auth.dto.response; | ||
|
||
public record RefreshTokenCheckResponse(boolean isRefreshTokenExist) { | ||
|
||
public static RefreshTokenCheckResponse from(boolean isRefreshTokenExist) { | ||
return new RefreshTokenCheckResponse(isRefreshTokenExist); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ class AuthServiceTest extends IntegrationTestSupport { | |
@Autowired | ||
private JwtTokenProvider jwtTokenProvider; | ||
|
||
@DisplayName("로그인 성공 : 존재하지 않는 회원이면 데이터베이스에 새로운 유저를 추가하고 토큰을 반환한다.") | ||
@DisplayName("로그인 성공 : 존재하지 않는 회원이면 데이터베이스에 새로운 유저를 추가하고 토큰 반환") | ||
@Test | ||
void login_signup() { | ||
// given | ||
|
@@ -61,7 +61,7 @@ void login_signup() { | |
assertThat(token.refreshToken()).isNotBlank(); | ||
} | ||
|
||
@DisplayName("로그인 성공 : 존재하는 회원이면 데이터베이스에 새로운 유저를 추가하지않고 토큰을 바로 반환한다.") | ||
@DisplayName("로그인 성공 : 존재하는 회원이면 데이터베이스에 새로운 유저를 추가하지않고 토큰 반환") | ||
@Test | ||
void login() { | ||
// given | ||
|
@@ -77,7 +77,7 @@ void login() { | |
assertThat(token.refreshToken()).isNotBlank(); | ||
} | ||
|
||
@DisplayName("로그인 성공 : 회원 가입시 디폴트 체크리스트 질문을 추가한다.") | ||
@DisplayName("로그인 성공 : 회원 가입시 디폴트 체크리스트 질문 추가") | ||
@Test | ||
void login_default_checklist_question() { | ||
// given | ||
|
@@ -100,7 +100,7 @@ void login_default_checklist_question() { | |
assertThat(sum).isEqualTo(Question.findDefaultQuestions().size()); | ||
} | ||
|
||
@DisplayName("로그인 성공 : 회원 가입시 디폴트 체크리스트를 추가한다.") | ||
@DisplayName("로그인 성공 : 회원 가입시 디폴트 체크리스트 추가") | ||
@Test | ||
void login_default_checklist() { | ||
// given | ||
|
@@ -116,7 +116,7 @@ void login_default_checklist() { | |
assertThat(response.checklists()).hasSize(1); | ||
} | ||
|
||
@DisplayName("게스트 유저 할당 실패 : 게스트 유저의 수가 2명이면 예외를 발생시킨다.") | ||
@DisplayName("게스트 유저 할당 실패 : 게스트 유저의 수가 2명이면 예외 발생") | ||
@Test | ||
void assignGuestUser_UnexpectedGuestUserExist() { | ||
// given | ||
|
@@ -129,7 +129,7 @@ void assignGuestUser_UnexpectedGuestUserExist() { | |
.hasMessage(ExceptionCode.GUEST_USER_UNEXPECTED_EXIST.getMessage()); | ||
} | ||
|
||
@DisplayName("게스트 유저 할당 실패 : 게스트 유저가 존재하지 않으면 예외를 발생시킨다.") | ||
@DisplayName("게스트 유저 할당 실패 : 게스트 유저가 존재하지 않으면 예외 발생") | ||
@Test | ||
void assingGuestUser_GuestUserNotExist() { | ||
// when & then | ||
|
@@ -169,15 +169,15 @@ void logout_invalid_ownership_exception() { | |
|
||
@DisplayName("액세스 토큰 재발행 성공") | ||
@Test | ||
void reIssueAccessToken() { | ||
void reissueAccessToken() { | ||
// given | ||
userRepository.save(UserFixture.USER1()); | ||
Mockito.when(oauthClient.requestOauthInfo(any(OauthLoginRequest.class))) | ||
.thenReturn(UserFixture.OAUTH_INFO_RESPONSE_USER1()); | ||
AuthTokenResponse tokenResponse = authService.login(OAUTH_LOGIN_REQUEST); | ||
|
||
// when & then | ||
assertThatCode(() -> authService.reIssueAccessToken(tokenResponse.refreshToken())) | ||
assertThatCode(() -> authService.reissueAccessToken(tokenResponse.refreshToken())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 pr에서 AuthServiceTest에 문장형으로 작성된 DisplayName 수정해도 편할 것 같아요~ |
||
.doesNotThrowAnyException(); | ||
|
||
} | ||
|
This file contains 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
Oops, something went wrong.
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.
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.
저희 id로 빼기로 했던 것 같아요!
일괄적으로 수정하는 일정이 있으면 따로 수정하지는 않아도 될 것 같지만 수정한 파트이길래 리뷰 남깁니다 👀
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.
테스트가 깨져서 추가한 부분이여서 제가 바꾸는 것보다 나중에 함께 수정하면 좋을 것 같아요~