@fluid-app/portal-sdk 0.1.117 → 0.1.118

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.
package/dist/index.cjs CHANGED
@@ -3151,9 +3151,8 @@ function isSlugInSection(item, currentSlug, navSlugs) {
3151
3151
  * useLogout Hook
3152
3152
  *
3153
3153
  * Provides a complete logout function that:
3154
- * 1. Calls `DELETE /logout` to clear the server-side session cookie
3155
- * 2. Clears all client-side state (query cache, IndexedDB, sessionStorage)
3156
- * 3. Reloads the page — Rails redirects unauthenticated HTML requests to the Hub
3154
+ * 1. Clears all client-side state (query cache, IndexedDB, sessionStorage)
3155
+ * 2. Navigates to GET /logout Rails clears the session and redirects to the Hub
3157
3156
  */
3158
3157
  /**
3159
3158
  * Hook that returns a `logout` function which clears the server session
@@ -3175,14 +3174,6 @@ function isSlugInSection(item, currentSlug, navSlugs) {
3175
3174
  function useLogout({ redirectUrl, onLogout } = {}) {
3176
3175
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
3177
3176
  return (0, react.useCallback)(async () => {
3178
- try {
3179
- const csrfToken = document.querySelector("meta[name=\"csrf-token\"]")?.getAttribute("content");
3180
- await fetch("/logout", {
3181
- method: "DELETE",
3182
- credentials: "include",
3183
- headers: csrfToken ? { "X-CSRF-Token": csrfToken } : {}
3184
- });
3185
- } catch {}
3186
3177
  await queryClient.cancelQueries();
3187
3178
  queryClient.clear();
3188
3179
  try {
@@ -3195,7 +3186,7 @@ function useLogout({ redirectUrl, onLogout } = {}) {
3195
3186
  } catch {}
3196
3187
  if (redirectUrl) window.location.href = redirectUrl;
3197
3188
  else if (onLogout) onLogout();
3198
- else window.location.reload();
3189
+ else window.location.href = "/logout";
3199
3190
  }, [
3200
3191
  queryClient,
3201
3192
  redirectUrl,