From a0c9cec5beb28448073b127c31df23134336f4cf Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Dec 2015 12:06:00 +1300 Subject: Implement REST login in the web app --- src/org/traccar/api/resource/SessionResource.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/org/traccar/api') diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java index fc0741f8c..347beb9a3 100644 --- a/src/org/traccar/api/resource/SessionResource.java +++ b/src/org/traccar/api/resource/SessionResource.java @@ -21,10 +21,12 @@ import org.traccar.model.User; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; @@ -70,4 +72,10 @@ public class SessionResource extends BaseResource { } } + @DELETE + public Response remove() { + req.getSession().removeAttribute(USER_ID_KEY); + return Response.noContent().build(); + } + } -- cgit v1.2.3