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