supabase error: Database error saving new user

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('/')
}
}
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!
10 Replies
春 | Haru
春 | HaruOP2y ago
anyone?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
春 | Haru
春 | HaruOP2y ago
Database error saving new user i really don't know what's wrong tbh. anyone?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
春 | Haru
春 | HaruOP2y ago
yes @nuxtjs/supabase
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
春 | Haru
春 | HaruOP2y ago
yes followed all steps on website, searched for some repos on Github, the code is the same, .env is ok too uh
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
春 | Haru
春 | HaruOP2y ago
lemme try it, but, im using username to register the user too, not the email and pass only. but i will try @christer
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server