conflict fix again

This commit is contained in:
Anthony Stirling
2025-10-12 21:13:01 +01:00
parent 45c438d66d
commit 884944527e
36 changed files with 74 additions and 139 deletions
@@ -212,19 +212,19 @@ public class ProprietaryUIDataController {
if (latestSession.isPresent()) {
SessionEntity sessionEntity = latestSession.get();
Date lastAccessedTime = sessionEntity.getLastRequest();
Instant lastAccessedTime =
Optional.ofNullable(sessionEntity.getLastRequest())
.orElse(Instant.EPOCH);
Instant now = Instant.now();
Instant expirationTime =
lastAccessedTime
.toInstant()
.plus(maxInactiveInterval, ChronoUnit.SECONDS);
lastAccessedTime.plus(maxInactiveInterval, ChronoUnit.SECONDS);
if (now.isAfter(expirationTime)) {
sessionPersistentRegistry.expireSession(sessionEntity.getSessionId());
} else {
hasActiveSession = !sessionEntity.isExpired();
}
lastRequest = sessionEntity.getLastRequest();
lastRequest = Date.from(lastAccessedTime);
} else {
lastRequest = new Date(0);
}
@@ -60,14 +60,14 @@ public class InitialSecuritySetup {
ApplicationProperties.Security.Jwt jwtProperties =
applicationProperties.getSecurity().getJwt();
boolean jwtEnabled = jwtProperties.isEnabled();
boolean jwtEnabled = jwtProperties.isEnableKeystore();
if (!v2Enabled || !jwtEnabled) {
log.debug(
"V2 enabled: {}, JWT enabled: {} - disabling all JWT features",
v2Enabled,
jwtEnabled);
jwtProperties.setKeyCleanup(false);
jwtProperties.setEnableKeyCleanup(false);
}
}
@@ -10,11 +10,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
<<<<<<< HEAD
import org.springframework.security.access.prepost.PreAuthorize;
=======
import org.springframework.beans.factory.annotation.Qualifier;
>>>>>>> refs/remotes/origin/V2
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.oauth2.core.user.OAuth2User;
@@ -203,7 +198,7 @@ public class AccountWebController {
return "login";
}
//@EnterpriseEndpoint
// @EnterpriseEndpoint
// @PreAuthorize("hasRole('ROLE_ADMIN')")
// @GetMapping("/usage")
@@ -4,8 +4,8 @@ import java.io.Serializable;
import org.springframework.security.core.GrantedAuthority;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
@@ -38,7 +38,8 @@ public class CustomUserDetailsService implements UserDetailsService {
"Your account has been locked due to too many failed login attempts.");
}
// TODO: Remove for SaaS - Handle legacy users without authenticationType (from versions < 1.3.0)
// TODO: Remove for SaaS - Handle legacy users without authenticationType (from versions <
// 1.3.0)
String authTypeStr = user.getAuthenticationType();
if (authTypeStr == null || authTypeStr.isEmpty()) {
// Migrate legacy users by detecting authentication type based on password presence