diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-18 16:05:35 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-18 16:05:35 +0500 |
commit | c9b67d19132b687bea9130f39f13a5515b120e5e (patch) | |
tree | 5890f28c060777ecb6be32b18daaa2d555496be6 /src/org/traccar/api/resource/SessionResource.java | |
parent | 3eca9acd6e6a160df8f7b86150429c3d7c09b0c3 (diff) | |
download | trackermap-server-c9b67d19132b687bea9130f39f13a5515b120e5e.tar.gz trackermap-server-c9b67d19132b687bea9130f39f13a5515b120e5e.tar.bz2 trackermap-server-c9b67d19132b687bea9130f39f13a5515b120e5e.zip |
Implement users tokens
Diffstat (limited to 'src/org/traccar/api/resource/SessionResource.java')
-rw-r--r-- | src/org/traccar/api/resource/SessionResource.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java index a61738c7e..6c5263123 100644 --- a/src/org/traccar/api/resource/SessionResource.java +++ b/src/org/traccar/api/resource/SessionResource.java @@ -69,6 +69,12 @@ public class SessionResource extends BaseResource { userId = user.getId(); request.getSession().setAttribute(USER_ID_KEY, userId); } + } else if (request.getParameter("token") != null) { + User user = Context.getPermissionsManager().getUserByToken(request.getParameter("token")); + if (user != null) { + userId = user.getId(); + request.getSession().setAttribute(USER_ID_KEY, userId); + } } } |