diff --git a/src/main/java/cmc15/backend/domain/account/service/AppleLoginService.java b/src/main/java/cmc15/backend/domain/account/service/AppleLoginService.java index c49358f..0fc3888 100644 --- a/src/main/java/cmc15/backend/domain/account/service/AppleLoginService.java +++ b/src/main/java/cmc15/backend/domain/account/service/AppleLoginService.java @@ -10,7 +10,6 @@ import cmc15.backend.domain.account.response.AppleSocialTokenInfoResponse; import cmc15.backend.global.config.jwt.TokenDecoder; import cmc15.backend.global.config.jwt.TokenProvider; -import cmc15.backend.global.exception.CustomException; import io.jsonwebtoken.JwsHeader; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; @@ -41,7 +40,6 @@ import static cmc15.backend.domain.account.entity.Authority.ROLE_USER; import static cmc15.backend.domain.account.entity.Platform.APPLE; -import static cmc15.backend.global.Result.DELETED_USER; import static java.net.URLEncoder.encode; import static java.nio.charset.StandardCharsets.UTF_8; @@ -84,7 +82,9 @@ public AccountResponse.OAuthConnection toSocialLoginAccount(Platform platform, S .build()) ); - validateDeleteUser(account); + if (account.getDeleteAt() != null) { + return AccountResponse.OAuthConnection.toRedirect(account, "none", "none", "https://previewinsure.vercel.app/callback/errorApple?isRegistered=true"); + } String atk = tokenProvider.createAccessToken(account.getAccountId(), getAuthentication(account.getEmail(), oAuthSettings.getNonEncryptionPassword())); String rtk = tokenProvider.createRefreshToken(account.getEmail()); @@ -94,12 +94,6 @@ public AccountResponse.OAuthConnection toSocialLoginAccount(Platform platform, S return AccountResponse.OAuthConnection.toRedirect(account, atk, rtk, successUrl); } - private static void validateDeleteUser(Account account) { - if (account.getDeleteAt() != null) { - throw new CustomException(DELETED_USER); - } - } - private AppleSocialTokenInfoResponse exchangeAppleSocialToken(String clientId, String clientSecret, String grantType, String code) { // 요청 파라미터 설정 UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromHttpUrl(APPLE_AUTH_URL)