typescript
export async function loginWithGoogle() {
const supabase = await createClient()
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
})
if (error) {
redirect('/unauthorized')
}
if (data.url) {
redirect(data.url)
}
}
typescript
export async function loginWithGoogle() {
const supabase = await createClient()
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
})
if (error) {
redirect('/unauthorized')
}
if (data.url) {
redirect(data.url)
}
}