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/resource | |
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/resource')
-rw-r--r-- | src/main/java/org/traccar/api/resource/UserResource.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/api/resource/UserResource.java b/src/main/java/org/traccar/api/resource/UserResource.java index cbee3bd4a..587be014b 100644 --- a/src/main/java/org/traccar/api/resource/UserResource.java +++ b/src/main/java/org/traccar/api/resource/UserResource.java @@ -15,6 +15,10 @@ */ package org.traccar.api.resource; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.core.Context; import org.traccar.api.BaseObjectResource; import org.traccar.config.Config; import org.traccar.helper.LogAction; @@ -47,6 +51,9 @@ public class UserResource extends BaseObjectResource<User> { @Inject private Config config; + @Context + private HttpServletRequest request; + public UserResource() { super(User.class); } @@ -111,4 +118,12 @@ public class UserResource extends BaseObjectResource<User> { return Response.ok(entity).build(); } + @Path("{id}") + @DELETE + public Response remove(@PathParam("id") long id) throws StorageException { + Response response = super.remove(id); + request.getSession().removeAttribute(SessionResource.USER_ID_KEY); + return response; + } + } |