@robosystems/core 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -131,17 +131,22 @@ export function AuthProvider({ children, apiUrl = process.env.NEXT_PUBLIC_ROBOSY
|
|
|
131
131
|
Promise.allSettled([clearGraphSelection(), clearEntitySelection()]),
|
|
132
132
|
new Promise((resolve) => setTimeout(resolve, 2000)),
|
|
133
133
|
]);
|
|
134
|
-
// Clear auth client cache and local
|
|
134
|
+
// Clear auth client cache and local storage state. Deliberately NO
|
|
135
|
+
// setUser(null) here: the hard navigation below tears the tree down
|
|
136
|
+
// anyway, and nulling the user first wakes AuthGuard, whose
|
|
137
|
+
// client-side redirect (→ /login → LoginRedirector → login home)
|
|
138
|
+
// can outrace the queued /logout navigation — the anchor session
|
|
139
|
+
// then survives and silently signs the user back in, undoing the
|
|
140
|
+
// logout (observed E2E under centralized login).
|
|
135
141
|
authClient.clearAuthCache();
|
|
136
|
-
setUser(null);
|
|
137
142
|
setSessionWarning({ show: false, timeLeft: 0 });
|
|
138
143
|
// Perform comprehensive cleanup of all user-specific data
|
|
139
144
|
performLogoutCleanup();
|
|
140
145
|
debugLog('Logout cleanup completed');
|
|
141
146
|
// Always hard-redirect out of the authenticated area. A full-page
|
|
142
147
|
// navigation (not a client-side router.push) guarantees the
|
|
143
|
-
// authenticated tree tears down
|
|
144
|
-
//
|
|
148
|
+
// authenticated tree tears down without AuthGuard racing it (see
|
|
149
|
+
// above). A forced logout (reason set, e.g.
|
|
145
150
|
// session_expired) goes to the login page so it can explain why the
|
|
146
151
|
// session ended and let the user sign back in. A manual logout on a
|
|
147
152
|
// product app chains through the login home's /logout so the anchor
|
package/package.json
CHANGED