No Error -> but I have to login my user twice usin...
# help-and-questions
j
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:
Copy code
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
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.