fix(cache): deshabilitar caché del navegador en llamadas API

Añadido cache: 'no-store' a conAuth() en todas las apps. El navegador
cacheaba respuestas GET de la API, causando que los cambios (crear lead,
cambiar estado, etc.) no se reflejaran hasta borrar cookies.

6 apps reconstruidas.
This commit is contained in:
2026-09-08 02:11:41 +00:00
parent 8c63e829f8
commit 2fc817887d
6 changed files with 6 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ export async function login(username: string, password: string): Promise<Usuario
export function conAuth(init: RequestInit = {}): RequestInit {
const token = getToken()
if (!token) return init
return { ...init, headers: { ...(init.headers as Record<string, string>), Authorization: `Bearer ${token}` } }
return { ...init, cache: "no-store", headers: { ...(init.headers as Record<string, string>), Authorization: `Bearer ${token}` } }
}
/** Si el API responde 401: cierra sesión y recarga para volver al login */