Supabase proper redirect
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
"use server";
|
||||
|
||||
import * as Core from "./core";
|
||||
import { createClient } from "@/lib/supabase";
|
||||
import { createClient } from "@/lib/supabase/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export async function signInWithGitHub() {
|
||||
export async function signInWithGitHub(origin: string) {
|
||||
const supabase = await createClient();
|
||||
|
||||
const { data, error } = await supabase.auth.signInWithOAuth({
|
||||
provider: "github",
|
||||
options: {
|
||||
redirectTo: `${origin}/api/auth/callback`,
|
||||
},
|
||||
});
|
||||
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user