added sign in/out on profile page
parent
b56e8ed628
commit
1b5279b1cc
@ -0,0 +1,12 @@
|
|||||||
|
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('/');
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue