From 283e7b221e84276da580dd8751ab8c607bd12cf3 Mon Sep 17 00:00:00 2001 From: Darya Umrikhina Date: Wed, 24 Jul 2024 17:41:50 +0400 Subject: [PATCH] Login:Components:Invite: add support for path type EmpInvite --- .../(root)/confirm/{LinkInvite => [Invite]}/page.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename packages/login/src/app/(root)/confirm/{LinkInvite => [Invite]}/page.tsx (92%) diff --git a/packages/login/src/app/(root)/confirm/LinkInvite/page.tsx b/packages/login/src/app/(root)/confirm/[Invite]/page.tsx similarity index 92% rename from packages/login/src/app/(root)/confirm/LinkInvite/page.tsx rename to packages/login/src/app/(root)/confirm/[Invite]/page.tsx index 9f44ec704d..bcf3f6ec6f 100644 --- a/packages/login/src/app/(root)/confirm/LinkInvite/page.tsx +++ b/packages/login/src/app/(root)/confirm/[Invite]/page.tsx @@ -24,7 +24,7 @@ // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -import { headers } from "next/headers"; +import { notFound } from "next/navigation"; import { FormWrapper } from "@docspace/shared/components/form-wrapper"; @@ -35,11 +35,12 @@ import { getSettings, getUserFromConfirm } from "@/utils/actions"; type LinkInviteProps = { searchParams: { [key: string]: string }; + params: { Invite: string }; }; -async function Page({ searchParams }: LinkInviteProps) { - const headersList = headers(); - const hostname = headersList.get("x-forwarded-host"); +async function Page({ searchParams, params }: LinkInviteProps) { + if (params.Invite !== "LinkInvite" && params.Invite !== "EmpInvite") + return notFound(); const type = searchParams.type; const uid = searchParams.uid; @@ -55,7 +56,6 @@ async function Page({ searchParams }: LinkInviteProps) { {settings && typeof settings !== "string" && ( <>