From b2fd97c36fb982dc638079dbeb2db117ffd4a6fc Mon Sep 17 00:00:00 2001 From: abhishekmg <34393560+abhishekmg@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:39:39 +0530 Subject: [PATCH] doc update : Updated the redirect path if user is not found (#22531) Updated the redirect path if user is not found Because the redirect path was `/` when I logged out and then went to something like `localhost:3000/` , this cause an infinite redirect loop and caused the app to break. Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/auth/server-side/nextjs.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/guides/auth/server-side/nextjs.mdx b/apps/docs/content/guides/auth/server-side/nextjs.mdx index c693e2c7e48..8ddc10fafa5 100644 --- a/apps/docs/content/guides/auth/server-side/nextjs.mdx +++ b/apps/docs/content/guides/auth/server-side/nextjs.mdx @@ -495,7 +495,7 @@ export default async function PrivatePage() { const { data, error } = await supabase.auth.getUser() if (error || !data?.user) { - redirect('/') + redirect('/login') } return
Hello {data.user.email}