You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ad...@apache.org on 2025/10/29 13:00:27 UTC
(fineract) 01/37: FINERACT-2391: check for AppUser type before casting Authentication Principal
This is an automated email from the ASF dual-hosted git repository.
adamsaghy pushed a commit to branch release/1.13.1
in repository https://gitbox.apache.org/repos/asf/fineract.git
commit 3c899d291248af1455019e140ff3034459cc2e47
Author: Nickesh <ni...@gmail.com>
AuthorDate: Thu Oct 9 18:43:37 2025 +0530
FINERACT-2391: check for AppUser type before casting Authentication Principal
---
.../apache/fineract/infrastructure/core/domain/AuditorAwareImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AuditorAwareImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AuditorAwareImpl.java
index 981dd8aa9d..fc93b7f6ce 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AuditorAwareImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AuditorAwareImpl.java
@@ -35,7 +35,7 @@ public class AuditorAwareImpl implements AuditorAware<Long> {
final SecurityContext securityContext = SecurityContextHolder.getContext();
if (securityContext != null) {
final Authentication authentication = securityContext.getAuthentication();
- if (authentication != null) {
+ if (authentication != null && authentication.getPrincipal() instanceof AppUser) {
currentUserId = Optional.ofNullable(((AppUser) authentication.getPrincipal()).getId());
} else {
currentUserId = retrieveSuperUser();