mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 04:27:34 +00:00
fix build
This commit is contained in:
@@ -54,7 +54,8 @@ export default async function Page(props: {
|
||||
token,
|
||||
});
|
||||
|
||||
const { idpInformation, userId, addHumanUser } = intent;
|
||||
const { idpInformation, userId } = intent;
|
||||
let { addHumanUser } = intent;
|
||||
|
||||
// sign in user. If user should be linked continue
|
||||
if (userId && !link) {
|
||||
@@ -121,7 +122,7 @@ export default async function Page(props: {
|
||||
// search for potential user via username, then link
|
||||
if (options?.isLinkingAllowed) {
|
||||
let foundUser;
|
||||
const email = addHumanUser.email?.email;
|
||||
const email = addHumanUser?.email?.email;
|
||||
|
||||
if (options.autoLinking === AutoLinkingOption.EMAIL && email) {
|
||||
foundUser = await listUsers({ serviceUrl, email }).then((response) => {
|
||||
@@ -177,10 +178,11 @@ export default async function Page(props: {
|
||||
|
||||
if (options?.isCreationAllowed && options.isAutoCreation) {
|
||||
let orgToRegisterOn: string | undefined = organization;
|
||||
let newUser;
|
||||
|
||||
if (
|
||||
!orgToRegisterOn &&
|
||||
addHumanUser.username && // username or email?
|
||||
addHumanUser?.username && // username or email?
|
||||
ORG_SUFFIX_REGEX.test(addHumanUser.username)
|
||||
) {
|
||||
const matched = ORG_SUFFIX_REGEX.exec(addHumanUser.username);
|
||||
@@ -203,21 +205,21 @@ export default async function Page(props: {
|
||||
}
|
||||
}
|
||||
|
||||
if (orgToRegisterOn) {
|
||||
if (addHumanUser && orgToRegisterOn) {
|
||||
const organizationSchema = create(OrganizationSchema, {
|
||||
org: { case: "orgId", value: orgToRegisterOn },
|
||||
});
|
||||
|
||||
addHumanUser = create(AddHumanUserRequestSchema, {
|
||||
const addHumanUserWithOrganization = create(AddHumanUserRequestSchema, {
|
||||
...addHumanUser,
|
||||
organization: organizationSchema,
|
||||
});
|
||||
}
|
||||
|
||||
const newUser = await addHuman({
|
||||
serviceUrl,
|
||||
request: addHumanUser,
|
||||
});
|
||||
newUser = await addHuman({
|
||||
serviceUrl,
|
||||
request: addHumanUserWithOrganization,
|
||||
});
|
||||
}
|
||||
|
||||
if (newUser) {
|
||||
return (
|
||||
|
@@ -14,7 +14,7 @@
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"generate": "buf generate https://github.com/zitadel/zitadel.git#tag=v2.71.1 --path ./proto/zitadel",
|
||||
"generate": "buf generate https://github.com/zitadel/zitadel.git --path ./proto/zitadel",
|
||||
"clean": "rm -rf zitadel .turbo node_modules google protoc-gen-openapiv2 validate"
|
||||
},
|
||||
"dependencies": {
|
||||
|
Reference in New Issue
Block a user