diff --git a/server/lib/consts.ts b/server/lib/consts.ts index 2fffc282..10320108 100644 --- a/server/lib/consts.ts +++ b/server/lib/consts.ts @@ -2,7 +2,7 @@ import path from "path"; import { fileURLToPath } from "url"; // This is a placeholder value replaced by the build process -export const APP_VERSION = "1.7.0"; +export const APP_VERSION = "1.7.2"; export const __FILENAME = fileURLToPath(import.meta.url); export const __DIRNAME = path.dirname(__FILENAME); diff --git a/server/routers/idp/validateOidcCallback.ts b/server/routers/idp/validateOidcCallback.ts index 6003c63d..9991ba9c 100644 --- a/server/routers/idp/validateOidcCallback.ts +++ b/server/routers/idp/validateOidcCallback.ts @@ -162,6 +162,12 @@ export async function validateOidcCallback( ); } + logger.debug("State verified", { + urL: ensureTrailingSlash(existingIdp.idpOidcConfig.tokenUrl), + expectedState, + state + }); + const tokens = await client.validateAuthorizationCode( ensureTrailingSlash(existingIdp.idpOidcConfig.tokenUrl), code, diff --git a/src/app/page.tsx b/src/app/page.tsx index 91ca5686..5c150c58 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,6 +12,7 @@ import { cleanRedirect } from "@app/lib/cleanRedirect"; import { Layout } from "@app/components/Layout"; import { InitialSetupCompleteResponse } from "@server/routers/auth"; import { cookies } from "next/headers"; +import { build } from "@server/build"; export const dynamic = "force-dynamic"; @@ -83,25 +84,27 @@ export default async function Page(props: { if (ownedOrg) { redirect(`/${ownedOrg.orgId}`); } else { - redirect("/setup"); + if (!env.flags.disableUserCreateOrg || user.serverAdmin) { + redirect("/setup"); + } } } - // return ( - // - // - //
- // ({ - // name: org.name, - // id: org.orgId - // }))} - // /> - //
- //
- //
- // ); + return ( + + +
+ ({ + name: org.name, + id: org.orgId + }))} + /> +
+
+
+ ); } diff --git a/src/components/OrganizationLanding.tsx b/src/components/OrganizationLanding.tsx index 2f3125b0..2d235c6d 100644 --- a/src/components/OrganizationLanding.tsx +++ b/src/components/OrganizationLanding.tsx @@ -41,35 +41,31 @@ export default function OrganizationLanding({ function getDescriptionText() { if (organizations.length === 0) { if (!disableCreateOrg) { - return t('componentsErrorNoMemberCreate'); + return t("componentsErrorNoMemberCreate"); } else { - return t('componentsErrorNoMember'); + return t("componentsErrorNoMember"); } } - return t('componentsMember', {count: organizations.length}); + return t("componentsMember", { count: organizations.length }); } return ( - {t('welcome')} + {t("welcome")} {getDescriptionText()} {organizations.length === 0 ? ( - disableCreateOrg ? ( -

- t('componentsErrorNoMember') -

- ) : ( + !disableCreateOrg && ( ) diff --git a/src/components/SecurityKeyForm.tsx b/src/components/SecurityKeyForm.tsx index d4970947..e343fc5f 100644 --- a/src/components/SecurityKeyForm.tsx +++ b/src/components/SecurityKeyForm.tsx @@ -103,8 +103,10 @@ export default function SecurityKeyForm({ }); useEffect(() => { - loadSecurityKeys(); - }, []); + if (open) { + loadSecurityKeys(); + } + }, [open]); const registerSchema = z.object({ name: z.string().min(1, { message: t("securityKeyNameRequired") }),