Skip to content

Commit 370d121

Browse files
committed
hotfix : PENDING상태 오류 해결
1 parent 5de09fb commit 370d121

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

greatjourney/src/main/java/backend/greatjourney/domain/user/service/SignService.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ public User saveUser(String email, String domain){
4343
throw new LoginException(HttpStatus.NOT_FOUND,404,"유저가 존재하지 않습니다. 회원가입이 필요합니다.",new LoginErrorResponse(email,domain));
4444
}
4545

46-
47-
return userRepository.findByEmail(email)
46+
User user = userRepository.findByEmail(email)
4847
.orElseThrow(()->new CustomException(ErrorCode.USER_NOT_FOUND));
4948

49+
if(user.getStatus() == Status.PENDING){
50+
throw new LoginException(HttpStatus.NOT_FOUND,404,"PENDING 상태의 유저입니다. 회원가입이 필요합니다.",new LoginErrorResponse(email,domain));
51+
}
52+
53+
54+
return user;
55+
5056
}
5157

5258

greatjourney/src/main/java/backend/greatjourney/global/exception/ErrorCode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public enum ErrorCode {
3939

4040
GOOGLE_USER_NOT_FOUND(NOT_FOUND,404,"구글 유저를 찾을 수 없습니다."),
4141

42+
PENDING_USER(BAD_REQUEST,404,"PENDING 상태의 유저입니다. 회원가입을 완료해주세요"),
43+
4244
HASH_MISMATCH(HttpStatus.BAD_REQUEST, 400, "인증 해시값이 일치하지 않습니다.")
4345

4446

0 commit comments

Comments
 (0)