Commit cfd9a0c6 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Handle successful login only for users

parent cd99afd5
......@@ -65,6 +65,8 @@ public class AuthenticationSuccessListener implements ApplicationListener<Authen"Successful login attempt for username={} from IP={}", userName, wad.getRemoteAddress());
if (principal instanceof BasicUser<?>) {
......@@ -359,6 +359,10 @@ public abstract class BasicUserServiceImpl<R extends GrantedAuthority, T extends
public void updateLastLogin(String userName) throws NoUserFoundException {
T u = getUserByEmail(userName);
if (u == null) {
throw new NoUserFoundException("No such user.");
u.setLastLogin(new Date());
// Set account to expire 1 year after last login
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment