aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/PasswordResource.java2
-rw-r--r--src/main/java/org/traccar/api/signature/TokenManager.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/resource/PasswordResource.java b/src/main/java/org/traccar/api/resource/PasswordResource.java
index 1fb08b02a..625ff4cb1 100644
--- a/src/main/java/org/traccar/api/resource/PasswordResource.java
+++ b/src/main/java/org/traccar/api/resource/PasswordResource.java
@@ -62,7 +62,7 @@ public class PasswordResource extends BaseResource {
new Columns.All(), new Condition.Equals("email", "email", email)));
if (user != null) {
var velocityContext = textTemplateFormatter.prepareContext(permissionsService.getServer(), user);
- velocityContext.put("token", tokenManager.generateToken(user.getId(), null));
+ velocityContext.put("token", tokenManager.generateToken(user.getId()));
var fullMessage = textTemplateFormatter.formatMessage(velocityContext, "passwordReset", "full");
mailManager.sendMessage(user, fullMessage.getSubject(), fullMessage.getBody());
}
diff --git a/src/main/java/org/traccar/api/signature/TokenManager.java b/src/main/java/org/traccar/api/signature/TokenManager.java
index a51234a95..a352ecc10 100644
--- a/src/main/java/org/traccar/api/signature/TokenManager.java
+++ b/src/main/java/org/traccar/api/signature/TokenManager.java
@@ -46,6 +46,10 @@ public class TokenManager {
this.cryptoManager = cryptoManager;
}
+ public String generateToken(long userId) throws IOException, GeneralSecurityException, StorageException {
+ return generateToken(userId, null);
+ }
+
public String generateToken(
long userId, Date expiration) throws IOException, GeneralSecurityException, StorageException {
Data data = new Data();