aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/resource
diff options
context:
space:
mode:
authordeveloperKurt <mustafakurt.business@gmail.com>2020-01-01 13:42:05 +0300
committerdeveloperKurt <mustafakurt.business@gmail.com>2020-01-01 13:42:05 +0300
commitfcad646a7c912463c53de946b2586e4a49a6e1ff (patch)
tree665e5f82a531d19ed2f762bb451157326f3a0e9c /src/main/java/org/traccar/api/resource
parent1ca6c8561f1aa21d5f73030bcd0ab3e9c578a9f1 (diff)
downloadtrackermap-server-fcad646a7c912463c53de946b2586e4a49a6e1ff.tar.gz
trackermap-server-fcad646a7c912463c53de946b2586e4a49a6e1ff.tar.bz2
trackermap-server-fcad646a7c912463c53de946b2586e4a49a6e1ff.zip
As requested in issue #4393, added logging IP address functionality when login attempts fail.
Diffstat (limited to 'src/main/java/org/traccar/api/resource')
-rw-r--r--src/main/java/org/traccar/api/resource/SessionResource.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/api/resource/SessionResource.java b/src/main/java/org/traccar/api/resource/SessionResource.java
index fd331c766..65e05a4a2 100644
--- a/src/main/java/org/traccar/api/resource/SessionResource.java
+++ b/src/main/java/org/traccar/api/resource/SessionResource.java
@@ -18,6 +18,7 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.helper.DataConverter;
+import org.traccar.helper.IpRetriever;
import org.traccar.helper.LogAction;
import org.traccar.model.User;
@@ -106,6 +107,7 @@ public class SessionResource extends BaseResource {
LogAction.login(user.getId());
return user;
} else {
+ LogAction.failedLogin(IpRetriever.retrieveIP(request));
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
}
}