diff options
author | Anton Tananaev <anton@traccar.org> | 2023-08-26 15:04:20 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-08-26 15:04:20 -0700 |
commit | 28ccd407642bac5ded03a256c43349dff9a67ee4 (patch) | |
tree | 011d7c511156c9db0f822bb0150b75f616fe98ba /src/main/java/org/traccar/api/security | |
parent | 4a5b8d79b560c7941960cc47c551d87b1a942320 (diff) | |
download | trackermap-server-28ccd407642bac5ded03a256c43349dff9a67ee4.tar.gz trackermap-server-28ccd407642bac5ded03a256c43349dff9a67ee4.tar.bz2 trackermap-server-28ccd407642bac5ded03a256c43349dff9a67ee4.zip |
Remove deleted account session
Diffstat (limited to 'src/main/java/org/traccar/api/security')
-rw-r--r-- | src/main/java/org/traccar/api/security/SecurityRequestFilter.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/api/security/SecurityRequestFilter.java b/src/main/java/org/traccar/api/security/SecurityRequestFilter.java index a34361854..ee964c9e4 100644 --- a/src/main/java/org/traccar/api/security/SecurityRequestFilter.java +++ b/src/main/java/org/traccar/api/security/SecurityRequestFilter.java @@ -101,9 +101,12 @@ public class SecurityRequestFilter implements ContainerRequestFilter { Long userId = (Long) request.getSession().getAttribute(SessionResource.USER_ID_KEY); if (userId != null) { - injector.getInstance(PermissionsService.class).getUser(userId).checkDisabled(); - statisticsManager.registerRequest(userId); - securityContext = new UserSecurityContext(new UserPrincipal(userId)); + User user = injector.getInstance(PermissionsService.class).getUser(userId); + if (user != null) { + user.checkDisabled(); + statisticsManager.registerRequest(userId); + securityContext = new UserSecurityContext(new UserPrincipal(userId)); + } } } |