From 9a278b1540754cd2264a958e11f053e3ef1cba8e Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 8 Nov 2025 21:20:49 +0000 Subject: [PATCH] completionId: cgen-c0575340e2b84fd28c7184e69b2f8d0b cgen-c0575340e2b84fd28c7184e69b2f8d0b --- client/contexts/AuthContext.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index 2c846637..a8cbe15e 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -786,6 +786,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ const shouldRemove = (key: string) => key.startsWith("sb-") || key.includes("supabase") || + key.includes("auth-token") || key.startsWith("mock_") || key.startsWith("demo_"); @@ -794,6 +795,17 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ .forEach((key) => { window.localStorage.removeItem(key); }); + + // Clear IndexedDB + if (window.indexedDB) { + const dbs = ["supabase", "sb_" + (process.env.VITE_SUPABASE_URL || "").split("/").pop()]; + dbs.forEach((dbName) => { + try { + const req = window.indexedDB.deleteDatabase(dbName); + req.onsuccess = () => console.log(`Cleared IndexedDB: ${dbName}`); + } catch {} + }); + } } catch {} } }, []);