diff --git a/src/main/java/life/mosu/mosuserver/application/auth/processor/SignUpAccountStepProcessor.java b/src/main/java/life/mosu/mosuserver/application/auth/processor/SignUpAccountStepProcessor.java index 4327f543..fa026aac 100644 --- a/src/main/java/life/mosu/mosuserver/application/auth/processor/SignUpAccountStepProcessor.java +++ b/src/main/java/life/mosu/mosuserver/application/auth/processor/SignUpAccountStepProcessor.java @@ -30,13 +30,10 @@ private void validateForNewSignUp(UserJpaEntity user) { userRepository.findByPhoneNumber(user.getOriginPhoneNumber()) .ifPresent(existingUser -> { - if (existingUser.isPendingUser()) { - switch (existingUser.getProvider()) { - case MOSU: - throw new CustomRuntimeException(ErrorCode.USER_ALREADY_EXISTS); - case KAKAO: - throw new CustomRuntimeException(ErrorCode.KAKAO_DUPLICATED); - } + if (existingUser.isKakaoUser()) { + throw new CustomRuntimeException(ErrorCode.KAKAO_DUPLICATED); + } else if (existingUser.isPendingUser() && existingUser.isMosuUser()) { + throw new CustomRuntimeException(ErrorCode.USER_ALREADY_EXISTS); } }); diff --git a/src/main/java/life/mosu/mosuserver/domain/user/entity/UserJpaEntity.java b/src/main/java/life/mosu/mosuserver/domain/user/entity/UserJpaEntity.java index 9afe7ec9..23d9bdda 100644 --- a/src/main/java/life/mosu/mosuserver/domain/user/entity/UserJpaEntity.java +++ b/src/main/java/life/mosu/mosuserver/domain/user/entity/UserJpaEntity.java @@ -112,6 +112,10 @@ public void updateUserInfo( public boolean isMosuUser() { return this.provider.equals(AuthProvider.MOSU); } + + public boolean isKakaoUser() { + return this.provider.equals(AuthProvider.KAKAO); + } public boolean isPendingUser() { return this.userRole.equals(UserRole.ROLE_PENDING); diff --git a/src/main/resources/application-base.yml b/src/main/resources/application-base.yml index 7301ede7..9af75c7e 100644 --- a/src/main/resources/application-base.yml +++ b/src/main/resources/application-base.yml @@ -10,6 +10,10 @@ server: include-stacktrace: never spring: + threads: + virtual: + enabled: true + config: import: - optional:file:.env[.properties]