const loading = ref(false)
const error = ref(null)
const supabase = useSupabaseClient()
async function signInWithGoogle() {
loading.value = true
error.value = null
try {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: "google",
options: {
redirectTo: `http://localhost:3000/confirm`,
},
})
if (error) {
throw error
}
} catch (err) {
console.error("Login error:", err)
loading.value = false
}
}
const loading = ref(false)
const error = ref(null)
const supabase = useSupabaseClient()
async function signInWithGoogle() {
loading.value = true
error.value = null
try {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: "google",
options: {
redirectTo: `http://localhost:3000/confirm`,
},
})
if (error) {
throw error
}
} catch (err) {
console.error("Login error:", err)
loading.value = false
}
}