© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
18 replies
matsyui

How to handle email already exist

Stack: Typescript, Expo, React Native

    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)
        }
    }


i want to throw error when email already exist in the auth, how do you guys handle that one with supabase auth
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Hello. Getting "Email already exists" internal server error
SupabaseSSupabase / help-and-questions
7mo ago
signUp() - how to show that user already exists
SupabaseSSupabase / help-and-questions
4y ago
How to handle JWT Expiring
SupabaseSSupabase / help-and-questions
4y ago
How to handle unregistered users?
SupabaseSSupabase / help-and-questions
4mo ago