aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/controllers')
-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();