From a8ea5f619cea8cc29289a91e3d4ac31a989759dd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 21 Sep 2023 21:05:32 -0700 Subject: Fix user deletion (fix #5183) --- src/main/java/org/traccar/api/resource/UserResource.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 { @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; } -- cgit v1.2.3