From 0456a0dcad430596cb058b65bfc3faae051d0b11 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 23 Dec 2019 13:39:08 +0300 Subject: Add return path to Social login API responses --- src/main/java/com/juick/server/api/ApiSocialLogin.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main') diff --git a/src/main/java/com/juick/server/api/ApiSocialLogin.java b/src/main/java/com/juick/server/api/ApiSocialLogin.java index c24d1618..164c71a4 100644 --- a/src/main/java/com/juick/server/api/ApiSocialLogin.java +++ b/src/main/java/com/juick/server/api/ApiSocialLogin.java @@ -190,6 +190,7 @@ public class ApiSocialLogin { } UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(redirectUrl); uriComponentsBuilder.queryParam("hash", userService.getHashByUID(uid)); + uriComponentsBuilder.queryParam("retpath", redirectUrl); return "redirect:" + uriComponentsBuilder.build().toUriString(); } else { if (!crosspostService.createFacebookUser(fbID, state, token.getAccessToken(), fb.getName())) { @@ -240,6 +241,7 @@ public class ApiSocialLogin { if (uid > 0) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(redirectUrl); uriComponentsBuilder.queryParam("hash", userService.getHashByUID(uid)); + uriComponentsBuilder.queryParam("retpath", redirectUrl); return "redirect:" + uriComponentsBuilder.build().toUriString(); } else { String loginhash = UUID.randomUUID().toString(); @@ -341,6 +343,7 @@ public class ApiSocialLogin { } UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(redirectUrl); uriComponentsBuilder.queryParam("hash", userService.getHashByUID(user.getUid())); + uriComponentsBuilder.queryParam("retpath", redirectUrl); return "redirect:" + uriComponentsBuilder.build().toUriString(); } else { String verificationCode = RandomStringUtils.randomAlphanumeric(8).toUpperCase(); -- cgit v1.2.3