aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-25 19:18:28 +0300
committerGravatar Vitaly Takmazov2018-11-25 19:18:28 +0300
commitf70dfc6d0b1226eec2500bd62057f8a8625f5ea5 (patch)
tree3007bfacfcd051a5b0fec39bb81224bb919ad328 /src/main
parent17fa861b4426018062c509ded6897b8d37a6f59a (diff)
Throw when email is already used
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/server/api/ApiSocialLogin.java2
1 files changed, 1 insertions, 1 deletions
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);