Updated edit permissions on settings components.

This commit is contained in:
Mike Cao 2025-09-19 17:58:52 -07:00
parent ffc8f6faae
commit 7effa16f00
15 changed files with 128 additions and 148 deletions

View file

@ -8,23 +8,18 @@ import { removeClientAuthToken } from '@/lib/client';
export function LogoutPage() {
const router = useRouter();
const { post } = useApi();
const disabled = process.env.cloudUrl;
useEffect(() => {
async function logout() {
await post('/auth/logout');
}
if (!disabled) {
removeClientAuthToken();
logout();
router.push('/login');
return () => setUser(null);
}
}, [disabled, router, post]);
removeClientAuthToken();
setUser(null);
logout();
}, [router, post]);
return null;
}