|
| 1 | +## [4.0.3] - 2026-01-26 |
| 2 | +### Features |
| 3 | +- Internationalization resilience and defaults |
| 4 | + - User-facing messages now provide sensible default text when a translation is missing. All MessageSource.getMessage(...) calls in UserAPI were updated to use the overload with a default message, e.g., "Password updated successfully", "Invalid old password", "Passwords do not match", etc., ensuring users never see an empty message due to missing bundle entries. |
| 5 | + - GlobalMessageControllerAdvice now falls back to the messageKey itself if no translation is found when resolving messages for views, preventing errors and guaranteeing some feedback is shown. |
| 6 | + |
| 7 | +### Fixes |
| 8 | +- Password update and profile update reliability (detached entity bug) |
| 9 | + - In UserAPI.updatePassword and UserAPI.updateUserAccount, the user is re-fetched from the database via userService.findUserByEmail(...) instead of relying on the DSUserDetails’ user instance, which could be detached from the JPA session. This prevents persistence issues when saving changes. |
| 10 | + - If the user cannot be re-fetched (e.g., missing from DB), the API now logs the issue and returns HTTP 400 with a localized "User not found" message. |
| 11 | +- More robust token handling and consistent message keys |
| 12 | + - TokenValidationResult message keys are now generated using TokenValidationResult.getValue() rather than name()/toString(). This standardizes keys to camelCase (e.g., invalidToken, expired) and aligns all code paths. |
| 13 | + - Reset password flow now: |
| 14 | + - Builds error messages using the standardized auth.message.<value> form with default fallbacks (e.g., "Invalid or expired token", "Invalid token"). |
| 15 | + - Returns clear, localized success and error messages with appropriate HTTP 400 statuses for validation failures (password mismatch, invalid token, invalid old password). |
| 16 | +- Improved user-facing feedback across APIs |
| 17 | + - Success responses for profile updates, password updates, and password resets use localized messages with safe defaults to avoid exposing raw keys. |
| 18 | + - Error responses consistently return HTTP 400 for validation issues with localized messaging and defaults. |
| 19 | + |
| 20 | +### Breaking Changes |
| 21 | +- Message key values in redirects have changed to camelCase |
| 22 | + - Redirects that include messageKey query parameters (e.g., in UserActionController) now use camelCase values derived from TokenValidationResult.getValue(), such as: |
| 23 | + - auth.message.invalidToken (was sometimes auth.message.invalid_token or auth.message.INVALID_TOKEN) |
| 24 | + - auth.message.expired (was auth.message.EXPIRED) |
| 25 | + - If front-end code or integrations depend on the exact messageKey values, update them to the new camelCase forms. |
| 26 | + |
| 27 | +### Refactoring |
| 28 | +- Internal consistency updates around message resolution: |
| 29 | + - Centralized use of MessageSource.getMessage with default messages and consistent message key construction. |
| 30 | + |
| 31 | +### Documentation |
| 32 | +- No documentation changes in this set. |
| 33 | + |
| 34 | +### Testing |
| 35 | +- UserActionControllerTest updated to expect the new camelCase message keys in redirects and model attributes: |
| 36 | + - invalidToken instead of invalid_token/INVALID_TOKEN |
| 37 | + - expired instead of EXPIRED |
| 38 | +- UserAPIUnitTest updates: |
| 39 | + - Mocks updated to use the 4-argument getMessage(...) signature with a default message parameter. |
| 40 | + - Tests now mock userService.findUserByEmail(...) to reflect the new re-fetch pattern in updatePassword and updateUserAccount. |
| 41 | + - Assertions aligned to the new success/error message paths. |
| 42 | + |
| 43 | +### Other Changes |
| 44 | +- Build/Version |
| 45 | + - Bumped project version to 4.0.3-SNAPSHOT in gradle.properties. |
| 46 | + |
1 | 47 | ## [4.0.2] - 2026-01-25 |
2 | 48 | ### Features |
3 | 49 | - Admin-initiated password reset with optional session invalidation |
|
0 commit comments