File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
src/main/java/life/mosu/mosuserver
application/auth/processor Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,10 @@ private void validateForNewSignUp(UserJpaEntity user) {
3030
3131 userRepository .findByPhoneNumber (user .getOriginPhoneNumber ())
3232 .ifPresent (existingUser -> {
33- if (existingUser .isPendingUser ()) {
34- switch (existingUser .getProvider ()) {
35- case MOSU :
36- throw new CustomRuntimeException (ErrorCode .USER_ALREADY_EXISTS );
37- case KAKAO :
38- throw new CustomRuntimeException (ErrorCode .KAKAO_DUPLICATED );
39- }
33+ if (existingUser .isKakaoUser ()) {
34+ throw new CustomRuntimeException (ErrorCode .KAKAO_DUPLICATED );
35+ } else if (existingUser .isPendingUser () && existingUser .isMosuUser ()) {
36+ throw new CustomRuntimeException (ErrorCode .USER_ALREADY_EXISTS );
4037 }
4138 });
4239
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ public void updateUserInfo(
112112 public boolean isMosuUser () {
113113 return this .provider .equals (AuthProvider .MOSU );
114114 }
115+
116+ public boolean isKakaoUser () {
117+ return this .provider .equals (AuthProvider .KAKAO );
118+ }
115119
116120 public boolean isPendingUser () {
117121 return this .userRole .equals (UserRole .ROLE_PENDING );
You can’t perform that action at this time.
0 commit comments