This commit is contained in:
Max Peintner
2024-10-28 14:52:26 +01:00
parent 0e07da3673
commit c9c8af2148
4 changed files with 68 additions and 36 deletions

View File

@@ -7,6 +7,7 @@ import {
getLegalAndSupportSettings,
getPasswordComplexitySettings,
} from "@/lib/zitadel";
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page({
@@ -21,11 +22,16 @@ export default async function Page({
searchParams;
if (!organization) {
const org = await getDefaultOrg();
const org: Organization | void = await getDefaultOrg().catch((error) => {
console.log("err");
});
if (!org) {
console.log("no default organization");
throw new Error("No default organization found");
}
console.log("org", org);
organization = org.id;
}

View File

@@ -185,7 +185,10 @@ export function RegisterFormWithoutPassword({
variant={ButtonVariants.Primary}
disabled={loading || !formState.isValid || !tosAndPolicyAccepted}
onClick={handleSubmit((values) =>
submitAndContinue(values, selected === methods[0] ? false : true),
submitAndContinue(
values,
selected.name === methods[0].name ? false : true,
),
)}
>
{loading && <Spinner className="h-5 w-5 mr-2" />}