const handleSignup = async () => {
if (
name.length < 1 ||
email.length < 1 ||
password.length < 1 ||
repeatPassword.length < 1
) {
setError('All fields are required');
} else if (!isEmailValid(email)) {
setError('Invalid Email Address')
} else if (password !== repeatPassword) {
setError('Passwords do not match');
} else {
const { data, error } = await supabase.auth.signUp({
email: email,
password: password,
options: {
data: {
fullname: name,
},
},
})
setIsLoading(true)
if (error) {
setError(error?.message)
console.error('Signup Error: ', error?.message)
} else {
navigation.navigate('Code', {
email_address: email,
});
console.log('Signup: ', data)
}
setIsLoading(false)
}
}
const handleSignup = async () => {
if (
name.length < 1 ||
email.length < 1 ||
password.length < 1 ||
repeatPassword.length < 1
) {
setError('All fields are required');
} else if (!isEmailValid(email)) {
setError('Invalid Email Address')
} else if (password !== repeatPassword) {
setError('Passwords do not match');
} else {
const { data, error } = await supabase.auth.signUp({
email: email,
password: password,
options: {
data: {
fullname: name,
},
},
})
setIsLoading(true)
if (error) {
setError(error?.message)
console.error('Signup Error: ', error?.message)
} else {
navigation.navigate('Code', {
email_address: email,
});
console.log('Signup: ', data)
}
setIsLoading(false)
}
}