aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-03 22:42:28 +0000
committerGravatar Vitaly Takmazov2018-05-03 22:42:28 +0000
commit0f1bfc4748186504d6aaa2a4f5f78383edb13a13 (patch)
treee2f806165f872370f6da1f7dce9595fad28bd45f /juick-www/src/main/java/com/juick/www
parent729017fa0267521cfa85279cbb36f23bd423adb0 (diff)
www: fix facebook redirects
Diffstat (limited to 'juick-www/src/main/java/com/juick/www')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java3
1 files changed, 2 insertions, 1 deletions
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())) {