Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix: invalidate cached auth token before it expires (#977)

gbirmanfcad1e07b171
diff --git a/js/app/packages/macro-entity/src/components/Provider.tsx b/js/app/packages/macro-entity/src/components/Provider.tsx
index 032d36cac9..02616cc3a2 100644
--- a/js/app/packages/macro-entity/src/components/Provider.tsx
+++ b/js/app/packages/macro-entity/src/components/Provider.tsx
@@ -34,9 +34,10 @@ function _reconcileEntities(
export function Provider(props: ParentProps) {
queryClient.setQueryDefaults(queryKeys.all.auth, {
- staleTime: 1000 * 60 * 60, // 1 hour
+ staleTime: 1000 * 60 * 55, // 55 minutes (token expires in 60 minutes)
gcTime: 1000 * 60 * 60 * 24, // 1 day
});
+ // inherits staleTime from auth query
queryClient.setQueryDefaults(queryKeys.auth.apiToken, {
queryFn: fetchApiToken,
});