mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
don't create a session if it does not exists
This commit is contained in:
@@ -75,10 +75,12 @@ public class UserService {
|
||||
* try to log in by checking if the user has an active session
|
||||
*/
|
||||
public Optional<User> login(HttpSession session) {
|
||||
User user = (User) session.getAttribute(SESSION_KEY_USER);
|
||||
if (user != null) {
|
||||
afterLogin(user);
|
||||
return Optional.of(user);
|
||||
if (session != null) {
|
||||
User user = (User) session.getAttribute(SESSION_KEY_USER);
|
||||
if (user != null) {
|
||||
afterLogin(user);
|
||||
return Optional.of(user);
|
||||
}
|
||||
}
|
||||
return Optional.absent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user