aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java b/juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java
index 1fb2c6a35..25ea645b5 100644
--- a/juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java
+++ b/juick-server/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java
@@ -83,12 +83,16 @@ public class CookieSimpleHashRememberMeServices extends AbstractRememberMeServic
throws RememberMeAuthenticationException, UsernameNotFoundException {
String hash = cookieTokens[0];
- if (StringUtils.isBlank(hash))
- throw new InvalidCookieException("Cookie is invalid, cookies " + cookieTokens);
+ if (StringUtils.isBlank(hash)) {
+ hash = request.getParameter("hash");
+ }
+ if (StringUtils.isBlank(hash)) {
+ throw new InvalidCookieException("Cookie is invalid and hash parameter not found");
+ }
- int uid = userService.getUIDbyHash(cookieTokens[0]);
+ int uid = userService.getUIDbyHash(hash);
if (uid <= 0)
- throw new UsernameNotFoundException("User not found bash hash, cookies" + cookieTokens);
+ throw new UsernameNotFoundException("User not found by hash, cookies" + cookieTokens);
Optional<User> userOptional = userService.getUserByUID(uid);