You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
291 B
TypeScript
13 lines
291 B
TypeScript
import { AuthError } from '@supabase/gotrue-js';
|
|
|
|
export const userSignOut = async (): Promise<AuthError | void> => {
|
|
const router = useRouter();
|
|
const supabase = useSupabaseAuthClient();
|
|
|
|
const { error } = await supabase.auth.signOut();
|
|
|
|
if (error) return error;
|
|
|
|
router.push('/');
|
|
};
|