From 535eb8d11fccfa7ba4bfcbe9e3d8a0bc9be8f247 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 26 Jul 2022 17:17:24 -0700 Subject: Fix password reset --- src/main/java/org/traccar/api/resource/PasswordResource.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3