From a1351fad251aa12a49d7050b733772e9ed66ae6e Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Wed, 22 May 2024 13:59:05 +0530 Subject: [PATCH] fix: create tenant --- .../components/tenants/creatNewTenant/CreateNewTenant.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ui/components/tenants/creatNewTenant/CreateNewTenant.tsx b/src/ui/components/tenants/creatNewTenant/CreateNewTenant.tsx index 5e0cc65..10860a1 100644 --- a/src/ui/components/tenants/creatNewTenant/CreateNewTenant.tsx +++ b/src/ui/components/tenants/creatNewTenant/CreateNewTenant.tsx @@ -40,12 +40,8 @@ export const CreateNewTenantDialog = ({ onCloseDialog }: { onCloseDialog: () => setIsCreatingTenant(true); const resp = await createTenant(tenantId); if (resp.status === "OK") { - if (resp.createdNew) { - navigate(`?tenantId=${tenantId.toLowerCase()}`); - onCloseDialog(); - } else { - setTenantCreationError("Tenant already exists"); - } + navigate(`?tenantId=${tenantId.toLowerCase()}`); + onCloseDialog(); } else if (resp.status === "MULTITENANCY_NOT_ENABLED_IN_CORE_ERROR") { setTenantCreationError( "Multitenancy is not enabled for your SuperTokens instance. Please add a license key to enable it."