-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Feature] - 인증과정 예외처리 #84
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
68b312c
feat: 로그인 응답에 데이터 추가, Response 생성 방식 캡슐화
Libienz 5312823
refactor: RestClient 예외 처리 작성
Libienz e69c133
feat: 서버 내부 에러 처리 핸들러 작성
Libienz d8a50bf
feat: Swagger api 정보 추가
Libienz 90c8cfd
fix: 최상위 예외 처리 코드 제거 개선
Libienz fb9308c
Merge branch 'develop/be' into feature/be/#81
Libienz 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
12 changes: 11 additions & 1 deletion
12
backend/src/main/java/woowacourse/touroot/authentication/dto/LoginResponse.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 |
---|---|---|
@@ -1,4 +1,14 @@ | ||
package woowacourse.touroot.authentication.dto; | ||
|
||
public record LoginResponse(String accessToken) { | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import woowacourse.touroot.member.domain.Member; | ||
|
||
public record LoginResponse( | ||
@Schema(description = "로그인된 유저의 닉네임") String nickname, | ||
@Schema(description = "로그인된 유저의 프로필 이미지 경로") String profileImageUrl, | ||
@Schema(description = "인가에 필요한 accessToken") String accessToken) { | ||
|
||
public static LoginResponse of(Member member, String accessToken) { | ||
return new LoginResponse(member.getNickname(), member.getProfileImageUri(), accessToken); | ||
} | ||
} |
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
backend/src/main/java/woowacourse/touroot/global/exception/ClientException.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 woowacourse.touroot.global.exception; | ||
|
||
public class ClientException extends RuntimeException { | ||
|
||
public ClientException(String message) { | ||
super(message); | ||
} | ||
} |
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.
질문) login이 성공됐다는 응답으로
nickname
,prifleImageUrl
이 어떤 상황에서 필요한가요? 어디에 쓰이는지 궁금합니당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.
제 생각에는 프론트엔드에서 활용할 수 있을 것 같습니다.
따로 사용자 정보 요청 API 호출 없이도 로그인 후에 바로 사용자 정보를 가져갈 수 있지 않을까용?
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.
리건 말이 맞습니다. 여러 서비스에서 로그인 되면 우측 상단에 프로필이미지랑 닉네임 뜨듯이 저희 서비스에서도 사용할 수 있는 맥락을 고려했어요