idk if i can ask this here but, can someone tell me what i'm doing wrong? i'm trying to make a register page using supabase auth, but i always got the error on title. tried everything already but nothing seems to work D: here's my code:
definePageMeta({
middleware: 'unauthenticated',
})
const isErrorVisible = ref(false)
const errorMessage = ref('')
const successMessage = ref('')
const supaAuth = useSupabaseAuthClient().auth;
const credentials = reactive({
username: '',
email: '',
password: ''
})
const userRegister = async () => {
const { error } = await supaAuth.signUp({
email: credentials.email,
password: credentials.password,
options: {
data: {
username: credentials.username,
}
}
})
if (error) {
errorMessage.value = error.message;
isErrorVisible.value = true;
} else {
successMessage.value = 'check your email for confirmation.'
return navigateTo('/')
}
}
thanks if someone can help me!