https://supabase.com/ logo
No Error -> but I have to login my user twice using Google Auth
j

Johnny008

05/25/2023, 5:12 AM
I am not sure why this is happening. I (and my test users) login via Supabase's Google oauth connection - but the first time they get redirected back to the base URL, and then they do the flow again and it works the second time. Has anyone else had this problem and know how to fix it by any chance? Here is the code snippet:
export async function signInWithGoogle() {
  const { session, user, error } = await supabase.auth.signInWithOAuth({
    provider: "google",
    options: {
      redirectTo: "https://www.website.com/dashboard",
      queryParams: {
        access_type: "offline",
        prompt: "consent",
        scopes: ["https://www.googleapis.com/auth/calendar.events"],
      },
    },
  });

  if (error) {
    console.log("Error: ", error);
  }
}
s

silentworks

05/25/2023, 4:13 PM
The code you've provided here won't be enough to help debug this issue. It's always best to provide a minimal reproducible example repo with the issue.