Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = 'com.flexcodelabs'
version = '0.0.27'
version = '0.0.28'
description = 'Flextuma App'

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ private String getUsername() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();

// Debug logging to understand the authentication context
log.debug("Authentication found: {}", auth != null);
if (auth != null) {
log.debug("Auth class: {}", auth.getClass().getSimpleName());
log.debug("Auth authenticated: {}", auth.isAuthenticated());
log.debug("Auth principal: {}", auth.getPrincipal());
log.debug("Auth name: {}", auth.getName());
log.debug("Auth details: {}", auth.getDetails());
log.debug("Auth authorities: {}", auth.getAuthorities());
} else {
log.debug("Authentication is null");
}
Expand All @@ -113,6 +115,7 @@ private String getUsername() {
String username = auth.getName();
// Don't return "SYSTEM" for actual authenticated users
if (username != null && !username.trim().isEmpty() && !"SYSTEM".equalsIgnoreCase(username)) {
log.debug("Returning username: {}", username);
return username;
}
}
Expand All @@ -126,19 +129,19 @@ private String getUsername() {
}
}

log.debug("Returning SYSTEM as fallback");
return "SYSTEM";
}

private HttpServletRequest getCurrentRequest() {
// Try to get current request from RequestContextHolder
try {
org.springframework.web.context.request.RequestAttributes attrs = org.springframework.web.context.request.RequestContextHolder
.getRequestAttributes();
if (attrs instanceof org.springframework.web.context.request.ServletRequestAttributes servletRequestAttributes) {
return servletRequestAttributes.getRequest();
}
} catch (Exception e) {
// Ignore - can't get current request
log.debug("❌❌❌❌ [RequestLoggingFilter] Could not get current request: {} ❌❌❌❌", e.getMessage());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.flexcodelabs.flextuma.core.entities.metadata;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.flexcodelabs.flextuma.core.entities.base.Owner;
import com.flexcodelabs.flextuma.core.entities.contact.Contact;
Expand All @@ -23,6 +24,7 @@ public abstract class AbstractMetadataEntity extends Owner {
private String description;

@ManyToMany
@JsonIgnore
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
private List<Contact> contacts = new ArrayList<>();
}
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spring.devtools.restart.enabled=true
# Enable INFO logging to see startup and seeding
logging.level.com.flexcodelabs.flextuma=INFO
logging.level.org.springframework.boot.autoconfigure=INFO
logging.level.com.flexcodelabs.flextuma.core.config.RequestLoggingFilter=DEBUG

spring.data.redis.host=${REDIS_HOST:redis}
spring.data.redis.port=${REDIS_PORT:6379}
Expand Down