aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-04-02 22:51:18 +0300
committerGravatar Vitaly Takmazov2017-04-05 14:02:56 +0300
commit4c99585f95cda1839f364524b6f68a16d063ed61 (patch)
tree18fa75536308c141cf1e34ce836859a5ef39f304 /juick-server/src/main/java
parent21e3db95d7d2eddbbd4f901d8628b129804d13f6 (diff)
fix login
Diffstat (limited to 'juick-server/src/main/java')
-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 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<User> userOptional = userService.getUserByUID(uid);