Supabase is not redirecting to my desired url with google oauth

I am using Supabase for my authentication. With Google OAuth, instead of redirecting to http://localhost:5000/dashboard, it redirects to http://localhost:5000/. How can I fix this?

In the Supabase authentication settings I have set the Site URL as http://localhost:5000/dashboard and have also added it as a redirect URL. In my Google Cloud console, I have set http://localhost:5000/dashboard as an authorised redirect URI and authorised JavaScript origin.

This is my client side code when the user clicks the ‘Sign up with Google’ button:

const { data, error } = await supabase.auth.signInWithOAuth({
    provider: 'google',
    options: {
        redirectTo: '/dashboard'
    }
});