From b8ed52051309bcb8f090a1e1c7d9bfb4afef7512 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 20 Nov 2020 02:17:53 +0300 Subject: Fix previous fix™️ --- src/main/java/com/juick/www/controllers/SocialLogin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main') 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 chats = telegramService.getAnonymous(); -- cgit v1.2.3