From 0f1bfc4748186504d6aaa2a4f5f78383edb13a13 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 3 May 2018 22:42:28 +0000 Subject: www: fix facebook redirects --- juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main') 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 522e9ab7..7be83748 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 @@ -129,6 +129,7 @@ public class SocialLogin { .apiKey(FACEBOOK_APPID) .apiSecret(FACEBOOK_SECRET) .callback(FACEBOOK_REDIRECT) + .scope("email") .state(state) .build(FacebookApi.instance()); OAuth2AccessToken token = facebookService.getAccessToken(code); @@ -155,7 +156,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:/"; } else if (fb.getVerified()) { if (!crosspostService.createFacebookUser(fbID, state, token.getAccessToken(), fb.getName(), fb.getLink())) { if (StringUtils.isNotEmpty(fb.getEmail())) { -- cgit v1.2.3