aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/controllers/SocialLogin.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-11-20 02:17:53 +0300
committerGravatar Vitaly Takmazov2020-11-20 02:17:53 +0300
commitb8ed52051309bcb8f090a1e1c7d9bfb4afef7512 (patch)
tree0c87559dc8dc124d982bc048fa1b6a80c0be9187 /src/main/java/com/juick/www/controllers/SocialLogin.java
parentc1a3274460680f8795469a43a5509cca08889db3 (diff)
Fix previous fix™️
Diffstat (limited to 'src/main/java/com/juick/www/controllers/SocialLogin.java')
-rw-r--r--src/main/java/com/juick/www/controllers/SocialLogin.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/controllers/SocialLogin.java b/src/main/java/com/juick/www/controllers/SocialLogin.java
index 6fcf9a3a..08ac9dc2 100644
--- a/src/main/java/com/juick/www/controllers/SocialLogin.java
+++ b/src/main/java/com/juick/www/controllers/SocialLogin.java
@@ -139,7 +139,7 @@ public class SocialLogin {
if (StringUtils.isBlank(code)) {
String fbstate = UUID.randomUUID().toString();
if (StringUtils.isBlank(state)) {
- state = Optional.of(referer).orElse("https://juick.com/");
+ state = Optional.ofNullable(referer).orElse("https://juick.com/");
}
crosspostService.addFacebookState(fbstate, state);
return "redirect:" + facebookAuthService.getAuthorizationUrl(fbstate);
@@ -281,7 +281,7 @@ public class SocialLogin {
Cookie c = new Cookie("hash", userService.getHashByUID(uid));
c.setMaxAge(50 * 24 * 60 * 60);
response.addCookie(c);
- return "redirect:/" + Optional.of(referer).orElse(StringUtils.EMPTY);
+ return "redirect:/" + Optional.ofNullable(referer).orElse(StringUtils.EMPTY);
} else {
String loginhash = UUID.randomUUID().toString();
if (!crosspostService.createVKUser(vkID, loginhash, token.getAccessToken(), vkName, vkLink)) {
@@ -311,7 +311,7 @@ public class SocialLogin {
Cookie c = new Cookie("hash", userService.getHashByUID(uid));
c.setMaxAge(50 * 24 * 60 * 60);
response.addCookie(c);
- return "redirect:/" + Optional.of(referer).orElse(StringUtils.EMPTY);
+ return "redirect:/" + Optional.ofNullable(referer).orElse(StringUtils.EMPTY);
} else {
String username = StringUtils.defaultString(params.get("username"), params.get("first_name"));
List<Long> chats = telegramService.getAnonymous();