diff --git a/src/lib/ae_api/api_delete_object.ts b/src/lib/ae_api/api_delete_object.ts index 4a6ef9e8..b7d991c3 100644 --- a/src/lib/ae_api/api_delete_object.ts +++ b/src/lib/ae_api/api_delete_object.ts @@ -1,3 +1,5 @@ +import { browser } from '$app/environment'; +import { ae_auth_error } from '$lib/stores/ae_stores'; import type { key_val } from '$lib/stores/ae_stores'; /** @@ -11,7 +13,7 @@ export const delete_object = async function delete_object({ headers = {}, params = {}, data = {}, - timeout = 60000, + timeout = 20000, return_meta = false, log_lvl = 0, retry_count = 5 @@ -200,6 +202,17 @@ export const delete_object = async function delete_object({ response.status === 403 || response.status === 422 ) { + if (response.status === 401 || response.status === 403) { + console.warn( + `AUTH DIAGNOSTICS (DELETE): Headers sent for ${endpoint}:`, + { + has_api_key: !!headers_cleaned['x-aether-api-key'], + has_account_id: !!headers_cleaned['x-account-id'] + } + ); + // Signal the root layout to show the session-expired banner. + if (browser) ae_auth_error.set({ type: 'expired', ts: Date.now() }); + } return false; } diff --git a/src/lib/ae_api/api_patch_object.ts b/src/lib/ae_api/api_patch_object.ts index d4c5f5ee..4d7a309f 100644 --- a/src/lib/ae_api/api_patch_object.ts +++ b/src/lib/ae_api/api_patch_object.ts @@ -13,7 +13,7 @@ export const patch_object = async function patch_object({ headers = {}, params = {}, data = {}, - timeout = 60000, + timeout = 20000, return_meta = false, log_lvl = 0, retry_count = 5