Skip to content

Commit

Permalink
fix : ErrorCode 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
YunJuwon0825 committed Feb 18, 2025
1 parent d4c3f2f commit 1f6b490
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum ErrorCode {
USER_NOT_AUTHENTICATED(HttpStatus.UNAUTHORIZED, "USER_401", "로그인 하지 않았습니다."),
USER_NOT_FOUND_BY_EMAIL(HttpStatus.NOT_FOUND, "USER_404", "이메일 없는 계정입니다."),
USER_ALREADY_EXISTS(HttpStatus.CONFLICT, "USER_409", "이미 가입된 사용자입니다."),
USER_REQUEST_NULL(HttpStatus.BAD_REQUEST, "USER_400", "사용자 정보가 없습니다."),

// Token Error
INVALID_REFRESH_TOKEN(HttpStatus.UNAUTHORIZED, "TOKEN_401", "리프레시 토큰이 유효하지 않습니다."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private static String getPrimaryEmail(String accessToken) {
// Github API 사용해서 이메일 가져오는 함수
public static String getGitHubPrimaryEmail(OAuth2UserRequest userRequest){
if (userRequest == null || userRequest.getAccessToken() == null) {
throw new BusinessException(ErrorCode.BAD_REQUEST);
throw new BusinessException(ErrorCode.USER_REQUEST_NULL);
}
String accessToken = userRequest.getAccessToken().getTokenValue();
return getPrimaryEmail(accessToken);
Expand Down

0 comments on commit 1f6b490

Please sign in to comment.