/**
* Try to log user via cookie data.
*/
@Override
protected Object loginViaCookie(String[] cookieData) {
UserAuthManager userAuthManager = AppCore.ref.getPetite().getBean(UserAuthManager.class);
Long id;
try {
id = Long.valueOf(cookieData[0]);
} catch (NumberFormatException ignore) {
return null;
}
User user = userAuthManager.findUser(id, cookieData[1]);
if (user == null) {
return null;
}
userAuthManager.login(user);
return new UserSession(user);
}