Login:Components:Invite: add support for path type EmpInvite

This commit is contained in:
Darya Umrikhina 2024-07-24 17:41:50 +04:00
parent 55840596be
commit 283e7b221e

View File

@ -24,7 +24,7 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // 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 // 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"; import { FormWrapper } from "@docspace/shared/components/form-wrapper";
@ -35,11 +35,12 @@ import { getSettings, getUserFromConfirm } from "@/utils/actions";
type LinkInviteProps = { type LinkInviteProps = {
searchParams: { [key: string]: string }; searchParams: { [key: string]: string };
params: { Invite: string };
}; };
async function Page({ searchParams }: LinkInviteProps) { async function Page({ searchParams, params }: LinkInviteProps) {
const headersList = headers(); if (params.Invite !== "LinkInvite" && params.Invite !== "EmpInvite")
const hostname = headersList.get("x-forwarded-host"); return notFound();
const type = searchParams.type; const type = searchParams.type;
const uid = searchParams.uid; const uid = searchParams.uid;
@ -55,7 +56,6 @@ async function Page({ searchParams }: LinkInviteProps) {
{settings && typeof settings !== "string" && ( {settings && typeof settings !== "string" && (
<> <>
<GreetingCleateUserContainer <GreetingCleateUserContainer
hostName={hostname}
type={type} type={type}
firstName={user?.firstName} firstName={user?.firstName}
lastName={user?.lastName} lastName={user?.lastName}