mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
Improve authentication session handling to prevent pages from disappearing
Update query options for the session endpoint to set staleTime, gcTime, and disable refetchOnWindowFocus and refetchOnMount. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: fe51a801-9ddd-4ebd-97be-42fe1cf117c5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/hiQP6r9 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
9c99d35836
commit
c4e451da90
1 changed files with 4 additions and 0 deletions
|
|
@ -27,6 +27,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
|||
const res = await fetch("/api/auth/session", { credentials: "include" });
|
||||
return res.json();
|
||||
},
|
||||
staleTime: 30000,
|
||||
gcTime: 60000,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnMount: false,
|
||||
});
|
||||
|
||||
const loginMutation = useMutation({
|
||||
|
|
|
|||
Loading…
Reference in a new issue