diff --git a/client/components/admin/AdminMemberManager.tsx b/client/components/admin/AdminMemberManager.tsx index ac5f6466..6b8fa0aa 100644 --- a/client/components/admin/AdminMemberManager.tsx +++ b/client/components/admin/AdminMemberManager.tsx @@ -132,7 +132,10 @@ const AdminMemberManager = ({ const [profileDraft, setProfileDraft] = useState(null); const selectedProfile = useMemo( - () => (profiles && Array.isArray(profiles)) ? profiles.find((profile) => profile.id === selectedId) ?? null : null, + () => + profiles && Array.isArray(profiles) + ? (profiles.find((profile) => profile.id === selectedId) ?? null) + : null, [profiles, selectedId], ); diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index a8cbe15e..2dd0f9f3 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -190,21 +190,26 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ // Clear all Supabase-related keys Object.keys(window.localStorage) - .filter((key) => - key.startsWith("sb-") || - key.includes("supabase") || - key.includes("auth-token") + .filter( + (key) => + key.startsWith("sb-") || + key.includes("supabase") || + key.includes("auth-token"), ) .forEach((key) => window.localStorage.removeItem(key)); // Clear IndexedDB (where Supabase stores sessions) if (window.indexedDB) { - const dbs = ["supabase", "sb_" + (process.env.VITE_SUPABASE_URL || "").split("/").pop()]; + 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}`); - req.onerror = (e) => console.warn(`Failed to clear IndexedDB: ${dbName}`, e); + req.onerror = (e) => + console.warn(`Failed to clear IndexedDB: ${dbName}`, e); } catch {} }); } @@ -798,7 +803,10 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ // Clear IndexedDB if (window.indexedDB) { - const dbs = ["supabase", "sb_" + (process.env.VITE_SUPABASE_URL || "").split("/").pop()]; + const dbs = [ + "supabase", + "sb_" + (process.env.VITE_SUPABASE_URL || "").split("/").pop(), + ]; dbs.forEach((dbName) => { try { const req = window.indexedDB.deleteDatabase(dbName); @@ -883,12 +891,16 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ // Clear IndexedDB (where Supabase stores sessions) if (window.indexedDB) { - const dbs = ["supabase", "sb_" + (process.env.VITE_SUPABASE_URL || "").split("/").pop()]; + 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}`); - req.onerror = (e) => console.warn(`Failed to clear IndexedDB: ${dbName}`, e); + req.onerror = (e) => + console.warn(`Failed to clear IndexedDB: ${dbName}`, e); } catch {} }); } diff --git a/server/index.ts b/server/index.ts index bef5b7f4..73e4d445 100644 --- a/server/index.ts +++ b/server/index.ts @@ -884,8 +884,7 @@ export function createServer() { try { const authHeader = req.headers.authorization; const token = - authHeader?.replace("Bearer ", "") || - (req.body?.token as string); + authHeader?.replace("Bearer ", "") || (req.body?.token as string); const adminToken = process.env.DISCORD_ADMIN_REGISTER_TOKEN; if (!adminToken || !token || token !== adminToken) { @@ -3011,11 +3010,9 @@ export function createServer() { .single(); if (!creator) { - return res - .status(404) - .json({ - error: "Creator profile not found. Create profile first.", - }); + return res.status(404).json({ + error: "Creator profile not found. Create profile first.", + }); } const { data, error } = await adminSupabase @@ -3387,11 +3384,9 @@ export function createServer() { .single(); if (!creator) { - return res - .status(404) - .json({ - error: "Creator profile not found. Create profile first.", - }); + return res.status(404).json({ + error: "Creator profile not found. Create profile first.", + }); } const { data: existing } = await adminSupabase