From f70dfc6d0b1226eec2500bd62057f8a8625f5ea5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 25 Nov 2018 19:18:28 +0300 Subject: Throw when email is already used --- src/main/java/com/juick/server/api/ApiSocialLogin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/juick/server/api/ApiSocialLogin.java b/src/main/java/com/juick/server/api/ApiSocialLogin.java index 7b9b56f0..72cda0af 100644 --- a/src/main/java/com/juick/server/api/ApiSocialLogin.java +++ b/src/main/java/com/juick/server/api/ApiSocialLogin.java @@ -302,7 +302,7 @@ public class ApiSocialLogin { GoogleIdToken idToken = verifier.verify(idTokenString); if (idToken != null) { String email = idToken.getPayload().getEmail(); - if (!userService.getUserByEmail(email).isAnonymous()) { + if (userService.getUserByEmail(email).isAnonymous()) { String verificationCode = RandomStringUtils.randomAlphanumeric(8).toUpperCase(); emailService.addVerificationCode(null, email, verificationCode); return new Auth(email, verificationCode); -- cgit v1.2.3