diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-26 17:17:24 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-26 17:17:24 -0700 |
commit | 535eb8d11fccfa7ba4bfcbe9e3d8a0bc9be8f247 (patch) | |
tree | 81d09c9e9e00bded2436cc055767a1b210a1790e /src/main/java | |
parent | 8f129e2a70abbea66f33213c84b7e63f9e96035a (diff) | |
download | trackermap-server-535eb8d11fccfa7ba4bfcbe9e3d8a0bc9be8f247.tar.gz trackermap-server-535eb8d11fccfa7ba4bfcbe9e3d8a0bc9be8f247.tar.bz2 trackermap-server-535eb8d11fccfa7ba4bfcbe9e3d8a0bc9be8f247.zip |
Fix password reset
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/api/resource/PasswordResource.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/api/resource/PasswordResource.java b/src/main/java/org/traccar/api/resource/PasswordResource.java index 88906e7e6..91c2d8ecf 100644 --- a/src/main/java/org/traccar/api/resource/PasswordResource.java +++ b/src/main/java/org/traccar/api/resource/PasswordResource.java @@ -58,7 +58,8 @@ public class PasswordResource extends BaseResource { if (user != null) { String token = UUID.randomUUID().toString().replaceAll("-", ""); user.set(PASSWORD_RESET_TOKEN, token); - storage.updateObject(user, new Request(new Columns.Exclude("id"), new Condition.Equals("id", "id"))); + storage.updateObject(user, new Request( + new Columns.Include("attributes"), new Condition.Equals("id", "id"))); var velocityContext = textTemplateFormatter.prepareContext(permissionsService.getServer(), user); velocityContext.put("token", token); @@ -79,7 +80,8 @@ public class PasswordResource extends BaseResource { if (user != null) { user.getAttributes().remove(PASSWORD_RESET_TOKEN); user.setPassword(password); - storage.updateObject(user, new Request(new Columns.Exclude("id"), new Condition.Equals("id", "id"))); + storage.updateObject(user, new Request( + new Columns.Include("attributes", "hashedPassword", "salt"), new Condition.Equals("id", "id"))); return Response.ok().build(); } return Response.status(Response.Status.NOT_FOUND).build(); |