diff options
Diffstat (limited to 'juick-common/src/main/java/com/juick/service/security/deprecated')
-rw-r--r-- | juick-common/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/juick-common/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java b/juick-common/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java index b658e16f..019ee502 100644 --- a/juick-common/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java +++ b/juick-common/src/main/java/com/juick/service/security/deprecated/CookieSimpleHashRememberMeServices.java @@ -80,13 +80,13 @@ public class CookieSimpleHashRememberMeServices extends AbstractRememberMeServic logger.debug("Creating new persistent login for user {}", username); try { - int uid = userService.getUIDbyName(username); + User user = userService.getUserByName(username); - Assert.isTrue(uid > 0); + Assert.isTrue(user.getUid() > 0); String hash = RandomStringUtils.randomAlphanumeric(16).toUpperCase(); - userService.setLoginForUser(uid, hash); + userService.setLoginForUser(user.getUid(), hash); setCookie(new String[]{hash}, getTokenValiditySeconds(), request, response); } catch (Exception e) { @@ -107,11 +107,11 @@ public class CookieSimpleHashRememberMeServices extends AbstractRememberMeServic throw new InvalidCookieException("Cookie is invalid and hash parameter not found"); } - int uid = userService.getUIDbyHash(hash); - if (uid <= 0) + User user = userService.getUserByHash(hash); + if (user.getUid() <= 0) throw new UsernameNotFoundException("User not found by hash, cookies" + cookieTokens); - Optional<User> userOptional = userService.getUserByUID(uid); + Optional<User> userOptional = userService.getUserByUID(user.getUid()); Assert.isTrue(userOptional.isPresent()); |