From 4c99585f95cda1839f364524b6f68a16d063ed61 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 2 Apr 2017 22:51:18 +0300 Subject: fix login --- .../deprecated/CookieSimpleHashRememberMeServices.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'juick-server/src/main/java/com/juick/service') 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 1fb2c6a3..25ea645b 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 userOptional = userService.getUserByUID(uid); -- cgit v1.2.3