aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/SessionResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/SessionResource.java')
-rw-r--r--src/org/traccar/api/resource/SessionResource.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java
index fa2a14c6f..3f7842626 100644
--- a/src/org/traccar/api/resource/SessionResource.java
+++ b/src/org/traccar/api/resource/SessionResource.java
@@ -17,6 +17,7 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
+import org.traccar.helper.LogAction;
import org.traccar.model.User;
import javax.annotation.security.PermitAll;
@@ -103,6 +104,7 @@ public class SessionResource extends BaseResource {
User user = Context.getPermissionsManager().login(email, password);
if (user != null) {
request.getSession().setAttribute(USER_ID_KEY, user.getId());
+ LogAction.login(user.getId());
return user;
} else {
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
@@ -111,6 +113,7 @@ public class SessionResource extends BaseResource {
@DELETE
public Response remove() {
+ LogAction.logout(getUserId());
request.getSession().removeAttribute(USER_ID_KEY);
return Response.noContent().build();
}