From 2e04d30a8e99669c7b6c2cd596bec60453a16a2d Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:05:19 +0000 Subject: [PATCH] Fix admin password reset email lookup --- .../security/controller/api/UserController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/proprietary/src/main/java/stirling/software/proprietary/security/controller/api/UserController.java b/app/proprietary/src/main/java/stirling/software/proprietary/security/controller/api/UserController.java index 50741e58a6..97b69b0bc2 100644 --- a/app/proprietary/src/main/java/stirling/software/proprietary/security/controller/api/UserController.java +++ b/app/proprietary/src/main/java/stirling/software/proprietary/security/controller/api/UserController.java @@ -628,7 +628,8 @@ public class UserController { .body(Map.of("error", "Email is not configured.")); } - if (user.getEmail() == null || user.getEmail().isBlank()) { + String userEmail = user.getUsername(); + if (userEmail == null || userEmail.isBlank()) { return ResponseEntity.status(HttpStatus.BAD_REQUEST) .body(Map.of("error", "User does not have an email address.")); } @@ -637,7 +638,10 @@ public class UserController { emailService .get() .sendPasswordChangedNotification( - user.getEmail(), user.getUsername(), includePassword ? finalPassword : null, loginUrl); + userEmail, + user.getUsername(), + includePassword ? finalPassword : null, + loginUrl); } return ResponseEntity.ok(Map.of("message", "User password updated successfully"));