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/security/SecurityRequestFilter.java | |
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/security/SecurityRequestFilter.java')
-rw-r--r-- | src/main/java/org/traccar/api/security/SecurityRequestFilter.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/api/security/SecurityRequestFilter.java b/src/main/java/org/traccar/api/security/SecurityRequestFilter.java index cb523177e..e308024da 100644 --- a/src/main/java/org/traccar/api/security/SecurityRequestFilter.java +++ b/src/main/java/org/traccar/api/security/SecurityRequestFilter.java @@ -82,13 +82,14 @@ public class SecurityRequestFilter implements ContainerRequestFilter { if (authHeader != null) { try { - User user; + LoginResult loginResult; if (authHeader.startsWith("Bearer ")) { - user = loginService.login(authHeader.substring(7)); + loginResult = loginService.login(authHeader.substring(7)); } else { String[] auth = decodeBasicAuth(authHeader); - user = loginService.login(auth[0], auth[1], null); + loginResult = loginService.login(auth[0], auth[1], null); } + User user = loginResult.getUser(); if (user != null) { statisticsManager.registerRequest(user.getId()); securityContext = new UserSecurityContext(new UserPrincipal(user.getId())); |