log out of medusa and reset cart on supabase logout

This commit is contained in:
2025-09-05 14:15:03 +03:00
parent c6f56f6e11
commit 95e72bb3f8
2 changed files with 7 additions and 3 deletions

View File

@@ -1,12 +1,14 @@
import { useMutation } from '@tanstack/react-query';
import { useSupabase } from './use-supabase';
import { signout } from '../../../features/medusa-storefront/src/lib/data/customer';
export function useSignOut() {
const client = useSupabase();
return useMutation({
mutationFn: () => {
mutationFn: async () => {
await signout(undefined, false);
return client.auth.signOut();
},
});