"use client";
import { createClient } from "@/utils/supabase/client";
export default function GoogleButton() {
async function signInWithGoogle() {
const supabase = createClient();
const { data, error } = await supabase.auth.signInWithOAuth({
provider: "google",
options: {
redirectTo: 'https://example.com/welcome',
}
});
if (error) {
console.error("Google sign-in error:", error.message);
}
}
return <button onClick={signInWithGoogle}>Sign in with Google</button>;
}
"use client";
import { createClient } from "@/utils/supabase/client";
export default function GoogleButton() {
async function signInWithGoogle() {
const supabase = createClient();
const { data, error } = await supabase.auth.signInWithOAuth({
provider: "google",
options: {
redirectTo: 'https://example.com/welcome',
}
});
if (error) {
console.error("Google sign-in error:", error.message);
}
}
return <button onClick={signInWithGoogle}>Sign in with Google</button>;
}