From 6fc88562fbfdc3f66f9e6f4d96f0ad8199a50863 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 7 Sep 2018 15:51:07 +0300 Subject: Fix Facebook redirect --- .../src/main/java/com/juick/server/www/controllers/SocialLogin.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'juick-server/src/main/java') 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 014a728d..5f21e052 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 @@ -111,6 +111,9 @@ public class SocialLogin { HttpServletResponse response) throws IOException, ExecutionException, InterruptedException { if (StringUtils.isBlank(code)) { String fbstate = UUID.randomUUID().toString(); + if (StringUtils.isBlank(state)) { + state = Utils.getPreviousPageByRequest(request).orElse("https://juick.com/"); + } crosspostService.addFacebookState(fbstate, state); OAuth20Service facebookAuthService = facebookBuilder .apiSecret(FACEBOOK_SECRET) -- cgit v1.2.3