addUserInfoToSession(user);
}
}
private static User getUserFromToken() {
Cookie cookie = request().cookies().get(TOKEN);
if (cookie == null) {
return User.anonymous;
}
String[] subject = StringUtils.split(cookie.value(), TOKEN_SEPARATOR);
if (ArrayUtils.getLength(subject) != TOKEN_LENGTH) {
return invalidToken();
}
User user = authenticateWithHashedPassword(subject[0], subject[1]);
if (user.isAnonymous()) {