From de785de9a48d00bdf2633c02b976be97ce8c8ddb Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 9 Apr 2017 21:17:09 +0300 Subject: fix fb and vk redirect --- juick-www/src/main/java/com/juick/www/controllers/FacebookLogin.java | 2 +- juick-www/src/main/java/com/juick/www/controllers/VKontakteLogin.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-www/src/main/java/com/juick/www/controllers') diff --git a/juick-www/src/main/java/com/juick/www/controllers/FacebookLogin.java b/juick-www/src/main/java/com/juick/www/controllers/FacebookLogin.java index e83bab92..e136af9b 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/FacebookLogin.java +++ b/juick-www/src/main/java/com/juick/www/controllers/FacebookLogin.java @@ -130,7 +130,7 @@ public class FacebookLogin { Cookie c = new Cookie("hash", userService.getHashByUID(uid)); c.setMaxAge(50 * 24 * 60 * 60); response.addCookie(c); - return Utils.getPreviousPageByRequest(request).orElse("/"); + return Utils.getPreviousPageByRequest(request).orElse("redirect:/"); } else if (fb.getVerified()) { String loginhash = UUID.randomUUID().toString(); if (!crosspostService.createFacebookUser(fbID, loginhash, token.getAccessToken(), fb.getName(), fb.getLink())) { diff --git a/juick-www/src/main/java/com/juick/www/controllers/VKontakteLogin.java b/juick-www/src/main/java/com/juick/www/controllers/VKontakteLogin.java index 12f90388..bc2ff719 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/VKontakteLogin.java +++ b/juick-www/src/main/java/com/juick/www/controllers/VKontakteLogin.java @@ -126,7 +126,7 @@ public class VKontakteLogin { Cookie c = new Cookie("hash", userService.getHashByUID(uid)); c.setMaxAge(50 * 24 * 60 * 60); response.addCookie(c); - return Utils.getPreviousPageByRequest(request).orElse("/"); + return Utils.getPreviousPageByRequest(request).orElse("redirect:/"); } else { String loginhash = UUID.randomUUID().toString(); if (!crosspostService.createVKUser(vkID, loginhash, token.getAccessToken(), vkName, vkLink)) { -- cgit v1.2.3