diff options
author | Anton Tananaev <anton@traccar.org> | 2023-11-26 08:03:53 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-11-26 08:03:53 -0800 |
commit | 08cb38a2126e91ccde44e9f91d2ad1f149c7e6b5 (patch) | |
tree | 50e6dafa01b673711dd305debf0dd7471fcc98bc /src/main/java/org/traccar/api/resource | |
parent | a59a6d19f575d8b593085ce19458c8fff18a6360 (diff) | |
download | trackermap-server-08cb38a2126e91ccde44e9f91d2ad1f149c7e6b5.tar.gz trackermap-server-08cb38a2126e91ccde44e9f91d2ad1f149c7e6b5.tar.bz2 trackermap-server-08cb38a2126e91ccde44e9f91d2ad1f149c7e6b5.zip |
Add login result class
Diffstat (limited to 'src/main/java/org/traccar/api/resource')
-rw-r--r-- | src/main/java/org/traccar/api/resource/SessionResource.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/api/resource/SessionResource.java b/src/main/java/org/traccar/api/resource/SessionResource.java index 90f0ceade..3e80e0020 100644 --- a/src/main/java/org/traccar/api/resource/SessionResource.java +++ b/src/main/java/org/traccar/api/resource/SessionResource.java @@ -82,7 +82,7 @@ public class SessionResource extends BaseResource { public User get(@QueryParam("token") String token) throws StorageException, IOException, GeneralSecurityException { if (token != null) { - User user = loginService.login(token); + User user = loginService.login(token).getUser(); if (user != null) { request.getSession().setAttribute(USER_ID_KEY, user.getId()); LogAction.login(user.getId(), WebHelper.retrieveRemoteAddress(request)); @@ -109,7 +109,7 @@ public class SessionResource extends BaseResource { } } if (email != null && password != null) { - User user = loginService.login(email, password, null); + User user = loginService.login(email, password, null).getUser(); if (user != null) { request.getSession().setAttribute(USER_ID_KEY, user.getId()); LogAction.login(user.getId(), WebHelper.retrieveRemoteAddress(request)); @@ -148,7 +148,7 @@ public class SessionResource extends BaseResource { @FormParam("code") Integer code) throws StorageException { User user; try { - user = loginService.login(email, password, code); + user = loginService.login(email, password, code).getUser(); } catch (CodeRequiredException e) { Response response = Response .status(Response.Status.UNAUTHORIZED) |