From 3c29dc90086d808bed24f615a2eaf690120efa52 Mon Sep 17 00:00:00 2001 From: h8570rg Date: Thu, 19 Dec 2024 18:23:54 +0900 Subject: [PATCH] fix: redirect --- app/(auth)/(routes)/login/(components)/LoginForm/actions.ts | 4 ++-- .../(routes)/register/(components)/RegisterForm/actions.ts | 4 ++-- app/(auth)/(routes)/register/page.tsx | 2 +- app/(main)/(components)/Navbar/index.tsx | 2 +- app/api/auth/callback/route.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/(auth)/(routes)/login/(components)/LoginForm/actions.ts b/app/(auth)/(routes)/login/(components)/LoginForm/actions.ts index 2e36496..6fca3fd 100644 --- a/app/(auth)/(routes)/login/(components)/LoginForm/actions.ts +++ b/app/(auth)/(routes)/login/(components)/LoginForm/actions.ts @@ -56,7 +56,7 @@ export async function signInEmail( } revalidatePath("/", "layout"); - redirect("/"); + redirect("/matches"); } /** @@ -80,5 +80,5 @@ export async function signInAnonymously() { const supabase = createClient(); await supabase.auth.signInAnonymously(); - redirect("/"); + redirect("/matches"); } diff --git a/app/(auth)/(routes)/register/(components)/RegisterForm/actions.ts b/app/(auth)/(routes)/register/(components)/RegisterForm/actions.ts index 965a984..a639d4d 100644 --- a/app/(auth)/(routes)/register/(components)/RegisterForm/actions.ts +++ b/app/(auth)/(routes)/register/(components)/RegisterForm/actions.ts @@ -57,8 +57,8 @@ export async function updateProfile( } } - revalidatePath("/"); - redirect("/"); + revalidatePath("/", "layout"); + redirect("/matches"); } export async function signOut() { diff --git a/app/(auth)/(routes)/register/page.tsx b/app/(auth)/(routes)/register/page.tsx index 8db591d..2a4bed9 100644 --- a/app/(auth)/(routes)/register/page.tsx +++ b/app/(auth)/(routes)/register/page.tsx @@ -14,7 +14,7 @@ export default async function RegisterPage() { const user = await getUserProfile(); if (user.name && user.janrecoId) { - redirect("/"); + redirect("/matches"); } return ( diff --git a/app/(main)/(components)/Navbar/index.tsx b/app/(main)/(components)/Navbar/index.tsx index 8d30d02..d92c405 100644 --- a/app/(main)/(components)/Navbar/index.tsx +++ b/app/(main)/(components)/Navbar/index.tsx @@ -14,7 +14,7 @@ export default function Navbar() { - + diff --git a/app/api/auth/callback/route.ts b/app/api/auth/callback/route.ts index 9a884af..c38fc77 100644 --- a/app/api/auth/callback/route.ts +++ b/app/api/auth/callback/route.ts @@ -20,7 +20,7 @@ export async function GET(request: Request) { if (profile.isUnregistered) { return NextResponse.redirect(`${origin}/register`); } - return NextResponse.redirect(`${origin}${next}`); + return NextResponse.redirect(`${origin}${next}/matches`); } }