aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-09-21 21:05:32 -0700
committerAnton Tananaev <anton@traccar.org>2023-09-21 21:05:44 -0700
commita8ea5f619cea8cc29289a91e3d4ac31a989759dd (patch)
treebe8f1f466537d1498b1608269e3c7ac5612c89b0 /src/main
parenta9c311855a495901935c2cb70252fa917fd88232 (diff)
downloadtrackermap-server-a8ea5f619cea8cc29289a91e3d4ac31a989759dd.tar.gz
trackermap-server-a8ea5f619cea8cc29289a91e3d4ac31a989759dd.tar.bz2
trackermap-server-a8ea5f619cea8cc29289a91e3d4ac31a989759dd.zip
Fix user deletion (fix #5183)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/api/resource/UserResource.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/resource/UserResource.java b/src/main/java/org/traccar/api/resource/UserResource.java
index 587be014b..d73e8b6f5 100644
--- a/src/main/java/org/traccar/api/resource/UserResource.java
+++ b/src/main/java/org/traccar/api/resource/UserResource.java
@@ -122,7 +122,9 @@ public class UserResource extends BaseObjectResource<User> {
@DELETE
public Response remove(@PathParam("id") long id) throws StorageException {
Response response = super.remove(id);
- request.getSession().removeAttribute(SessionResource.USER_ID_KEY);
+ if (getUserId() == id) {
+ request.getSession().removeAttribute(SessionResource.USER_ID_KEY);
+ }
return response;
}