diff options
author | Vitaly Takmazov | 2021-10-18 00:40:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-10-18 02:10:01 +0300 |
commit | a2348e95bbacbc9a9961afcabb7bbe82f3c7fe9d (patch) | |
tree | 7c794eba8ce72e6533a818fcbfb3c8f87e36d2f8 /src/main/java/com/juick/www/controllers/SignUp.java | |
parent | 6c82f3dea2c56e8d62bd2f154e2e701f96454418 (diff) |
Display error for social login
* CrossPostService gone
Diffstat (limited to 'src/main/java/com/juick/www/controllers/SignUp.java')
-rw-r--r-- | src/main/java/com/juick/www/controllers/SignUp.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/main/java/com/juick/www/controllers/SignUp.java b/src/main/java/com/juick/www/controllers/SignUp.java index c07374f55..9fc04dd55 100644 --- a/src/main/java/com/juick/www/controllers/SignUp.java +++ b/src/main/java/com/juick/www/controllers/SignUp.java @@ -21,7 +21,6 @@ import com.juick.util.HttpBadRequestException; import com.juick.util.HttpForbiddenException; import com.juick.util.UsernameTakenException; import com.juick.www.WebApp; -import com.juick.service.CrosspostService; import com.juick.service.EmailService; import com.juick.service.UserService; import com.juick.service.security.annotation.Visitor; @@ -46,8 +45,6 @@ public class SignUp { @Inject private UserService userService; @Inject - private CrosspostService crosspostService; - @Inject private EmailService emailService; @Inject private WebApp webApp; @@ -65,16 +62,16 @@ public class SignUp { String account = null; switch (type) { case "fb": - account = crosspostService.getFacebookNameByHash(hash); + account = userService.getFacebookNameByHash(hash); break; case "vk": - account = crosspostService.getVKNameByHash(hash); + account = userService.getVKNameByHash(hash); break; case "xmpp": - account = crosspostService.getJIDByHash(hash); + account = userService.getJIDByHash(hash); break; case "durov": - account = crosspostService.getTelegramNameByHash(hash); + account = userService.getTelegramNameByHash(hash); break; case "email": account = emailService.getEmailByAuthCode(hash); @@ -128,11 +125,11 @@ public class SignUp { return "views/signup_result"; } - if (!(type.charAt(0) == 'f' && crosspostService.setFacebookUser(hash, current.getUid())) - && !(type.charAt(0) == 'v' && crosspostService.setVKUser(hash, current.getUid())) - && !(type.charAt(0) == 'd' && crosspostService.setTelegramUser(hash, current.getUid())) + if (!(type.charAt(0) == 'f' && userService.setFacebookUser(hash, current.getUid())) + && !(type.charAt(0) == 'v' && userService.setVKUser(hash, current.getUid())) + && !(type.charAt(0) == 'd' && userService.setTelegramUser(hash, current.getUid())) && !(type.charAt(0) == 'x' && userService.getAllJIDs(visitor).size() > 0 - && crosspostService.setJIDUser(hash, current.getUid()))) { + && userService.setJIDUser(hash, current.getUid()))) { if (type.equals("email")) { String email = emailService.getEmailByAuthCode(hash); emailService.addEmail(current.getUid(), email); @@ -163,9 +160,9 @@ public class SignUp { return "views/signup_result"; } - if (!(type.charAt(0) == 'f' && crosspostService.setFacebookUser(hash, current.getUid())) - && !(type.charAt(0) == 'v' && crosspostService.setVKUser(hash, current.getUid())) - && !(type.charAt(0) == 'd' && crosspostService.setTelegramUser(hash, current.getUid()))) { + if (!(type.charAt(0) == 'f' && userService.setFacebookUser(hash, current.getUid())) + && !(type.charAt(0) == 'v' && userService.setVKUser(hash, current.getUid())) + && !(type.charAt(0) == 'd' && userService.setTelegramUser(hash, current.getUid()))) { if (type.equals("email")) { String email = emailService.getEmailByAuthCode(hash); emailService.addEmail(current.getUid(), email); |