From 7e73ada4e2e568818f9221068c8687728f2c9ce8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 7 Sep 2018 15:56:34 +0300 Subject: Fix referer redirect --- .../src/main/java/com/juick/server/www/controllers/SocialLogin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/java/com/juick/server/www/controllers') diff --git a/juick-server/src/main/java/com/juick/server/www/controllers/SocialLogin.java b/juick-server/src/main/java/com/juick/server/www/controllers/SocialLogin.java index 5f21e052..46e25d81 100644 --- a/juick-server/src/main/java/com/juick/server/www/controllers/SocialLogin.java +++ b/juick-server/src/main/java/com/juick/server/www/controllers/SocialLogin.java @@ -280,7 +280,7 @@ public class SocialLogin { Cookie c = new Cookie("hash", userService.getHashByUID(uid)); c.setMaxAge(50 * 24 * 60 * 60); response.addCookie(c); - return Utils.getPreviousPageByRequest(request).orElse("redirect:/"); + return "redirect:/" + Utils.getPreviousPageByRequest(request).orElse(StringUtils.EMPTY); } else { String loginhash = UUID.randomUUID().toString(); if (!crosspostService.createVKUser(vkID, loginhash, token.getAccessToken(), vkName, vkLink)) { @@ -310,7 +310,7 @@ public class SocialLogin { Cookie c = new Cookie("hash", userService.getHashByUID(uid)); c.setMaxAge(50 * 24 * 60 * 60); response.addCookie(c); - return Utils.getPreviousPageByRequest(request).orElse("redirect:/"); + return "redirect:/" + Utils.getPreviousPageByRequest(request).orElse(StringUtils.EMPTY); } else { String username = StringUtils.defaultString(params.get("username"), params.get("first_name")); telegramService.createTelegramUser(tgUser, username); -- cgit v1.2.3