nick9822 commented on code in PR #5094:
URL: https://github.com/apache/fineract/pull/5094#discussion_r2432344439
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AuditorAwareImpl.java:
##########
@@ -35,7 +35,7 @@ public Optional<Long> getCurrentAuditor() {
final SecurityContext securityContext =
SecurityContextHolder.getContext();
if (securityContext != null) {
final Authentication authentication =
securityContext.getAuthentication();
- if (authentication != null) {
+ if (authentication != null && authentication.getPrincipal()
instanceof AppUser) {
Review Comment:
I think in two cases the principal won't be an `AppUser`, the public
non-auth endpoints (self-service in this case) or any scheduler/worker related
cases where chances are principal being empty or a string `anonymousUser`. I
feel it's better to fallback on system user instead of admin user. I see
there's a already a TODO comment on line#50 which happens to be the same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]