+ Manually trigger the daily maintenance job which includes:
+
+
+
+ •
+ Mark stalled sessions as timed out
+
+
+ •
+ Aggregate yesterday's metrics into historical snapshots
+
+
+ •
+ Clean up old data based on retention policies
+
+
+
+
+
+
+ Warning: This operation runs across all tenants and may take several minutes to complete.
+ Use this only for testing or when immediate cleanup is needed.
+
+
+
+
+
+
+
+
+
+
+
+ {/* Future Admin Functions Placeholder */}
+
+
+
+
Additional Admin Functions
+
+
+ Additional cross-tenant administrative operations will be added here as needed.
+
- Manually trigger the daily maintenance job which includes:
-
-
-
- •
- Mark stalled sessions as timed out
-
-
- •
- Aggregate yesterday's metrics into historical snapshots
-
-
- •
- Clean up old data based on retention policies
-
-
-
-
-
-
- Warning: This operation runs across all tenants and may take several minutes to complete.
- Use this only for testing or when immediate cleanup is needed.
-
diff --git a/src/Web/autopilot-monitor-web/contexts/TenantContext.tsx b/src/Web/autopilot-monitor-web/contexts/TenantContext.tsx
index acdba9b4..c11e71b1 100644
--- a/src/Web/autopilot-monitor-web/contexts/TenantContext.tsx
+++ b/src/Web/autopilot-monitor-web/contexts/TenantContext.tsx
@@ -26,9 +26,10 @@ export function TenantProvider({ children }: { children: React.ReactNode }) {
// Update tenant ID from authenticated user
useEffect(() => {
if (!isLoading && isAuthenticated && user) {
- // Use tenant ID from authenticated user
+ // Use tenant ID from authenticated user's token
+ // This is the APPLICATION tenant ID, not the Azure AD tenant ID
if (user.tenantId && user.tenantId !== tenantId) {
- console.log(`[TenantContext] Setting tenant ID from auth: ${user.tenantId}`);
+ console.log(`[TenantContext] Setting application tenant ID from auth: ${user.tenantId}`);
setTenantId(user.tenantId);
}
} else if (!isLoading && !isAuthenticated) {
diff --git a/src/Web/autopilot-monitor-web/lib/msalConfig.ts b/src/Web/autopilot-monitor-web/lib/msalConfig.ts
index e39fd8df..00c8a799 100644
--- a/src/Web/autopilot-monitor-web/lib/msalConfig.ts
+++ b/src/Web/autopilot-monitor-web/lib/msalConfig.ts
@@ -19,7 +19,7 @@ export const msalConfig: Configuration = {
navigateToLoginRequestUrl: true,
},
cache: {
- cacheLocation: "localStorage", // "sessionStorage" or "localStorage"
+ cacheLocation: "sessionStorage", // Using sessionStorage for better XSS protection
storeAuthStateInCookie: false, // Set to true for IE11 or Edge legacy
},
system: {