© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
39 replies
Floppy Disk

`emailRedirectTo` doesnt seem to work:

I have following code:
export const getUrl = () => {
    let url =
        import.meta.env.PROD ?
            import.meta.env.VITE_WEBSITE_URL :
            'http://localhost:5173/'
    url = url.startsWith('http') ? url : `https://${url}`
    url = url.endsWith('/') ? url : `${url}/`
    return url
}

export const signUp = async (email: string, password: string, first_name: string, last_name: string) => {
    return await supabase.auth.signUp({
        email: email,
        password: password,
        options: {
            data: {
                first_name,
                last_name,
            },
            emailRedirectTo: getUrl(),
        },
    })
}
export const getUrl = () => {
    let url =
        import.meta.env.PROD ?
            import.meta.env.VITE_WEBSITE_URL :
            'http://localhost:5173/'
    url = url.startsWith('http') ? url : `https://${url}`
    url = url.endsWith('/') ? url : `${url}/`
    return url
}

export const signUp = async (email: string, password: string, first_name: string, last_name: string) => {
    return await supabase.auth.signUp({
        email: email,
        password: password,
        options: {
            data: {
                first_name,
                last_name,
            },
            emailRedirectTo: getUrl(),
        },
    })
}


And in Prod env I'm still getting redirected to localhost, I checked PROD var and WEBSITE_URL and they are set properly. What am I missing?
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

Realtime listener doesnt seem to get anything
SupabaseSSupabase / help-and-questions
3y ago
Magic Link emailRedirectTo Parameter Being Ignored
SupabaseSSupabase / help-and-questions
4mo ago
CRON SCHEDULER DOESNT WORK!?
SupabaseSSupabase / help-and-questions
7mo ago
Restore to a new project - doesnt work
SupabaseSSupabase / help-and-questions
2mo ago