diff --git a/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleSignInUserCase.java b/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleSignInUserCase.java index 42bcbd67..8db12737 100644 --- a/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleSignInUserCase.java +++ b/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleSignInUserCase.java @@ -29,14 +29,12 @@ public Member getUserData(String accessToken) { .bodyToMono(GoogleUserResponse.class) .block(); -// googleTokenUserCase.verifyAccessToken(googleUserResponse.getAud()); - if (googleUserResponse != null) { + googleTokenUserCase.verifyAccessToken(googleUserResponse.getAud()); googleUserResponse.adaptResponse(); return memberMapper.createGoogleMember(googleUserResponse); } - return null; + throw new TokenInvalidException(); } - } diff --git a/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleTokenUserCase.java b/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleTokenUserCase.java index b61cf800..653e7c71 100644 --- a/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleTokenUserCase.java +++ b/src/main/java/com/moing/backend/domain/auth/application/service/google/GoogleTokenUserCase.java @@ -18,7 +18,7 @@ public class GoogleTokenUserCase { public void verifyAccessToken(String aud) { String extractedAppId = Arrays.stream(aud.split("-")) .findFirst() - .orElseThrow(() -> new TokenInvalidException()); + .orElseThrow(TokenInvalidException::new); if (!appId.equals(extractedAppId)) throw new AppIdInvalidException(); }