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.

32 lines
608 B
TypeScript

import { AuthError } from '@supabase/gotrue-js';
const returnMain = (): void => {
navigateTo('/notes');
};
const userSignOut = async (): Promise<AuthError | void> => {
const supabase = useSupabaseAuthClient();
const { error } = await supabase.auth.signOut();
if (error) return error;
returnMain();
};
const userSignIn = async (
email: string,
password: string
): Promise<AuthError | void> => {
const { error } = await useSupabaseAuthClient().auth.signInWithPassword({
email: email,
password: password,
});
if (error) return error;
returnMain();
};
export { userSignOut, userSignIn };