From f3688408e1513fdd7c0af0a28b5d82be31d5cced Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 15 Feb 2018 14:38:52 +0300 Subject: www: register telegram user --- juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-www') 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); -- cgit v1.2.3