diff options
author | Vitaly Takmazov | 2018-02-15 14:38:52 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-02-15 14:38:52 +0300 |
commit | f3688408e1513fdd7c0af0a28b5d82be31d5cced (patch) | |
tree | f69b0dfbbea85d6a42eaeea88ab65a8bbea5ffc7 | |
parent | 5627e75ae2e816227d1274aceeb2d5c138d27278 (diff) |
www: register telegram user
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java b/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java index b9d3c9c7..64d59b9f 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java +++ b/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java @@ -311,7 +311,9 @@ public class SocialLogin { response.addCookie(c); return Utils.getPreviousPageByRequest(request).orElse("redirect:/"); } else { - logger.warn("invalid user {}", tgUser); + String username = StringUtils.defaultString(params.get("username"), params.get("first_name")); + telegramService.createTelegramUser(tgUser, username); + return "redirect:/signup?type=durov&hash=" + userService.getSignUpHashByTelegramID(tgUser, username); } } else { logger.warn("invalid tg hash {} for {}", resultString, hash); |