fix: ordering of conditions

This commit is contained in:
Max Peintner
2024-12-27 11:48:11 +01:00
parent 52d9753358
commit aa6a597191

View File

@@ -153,8 +153,11 @@ export default async function Page(props: {
}
}
// if link === true, do not create user
if (options?.isCreationAllowed && options.isAutoCreation && !link) {
if (link) {
return linkingFailed(branding);
}
if (options?.isCreationAllowed && options.isAutoCreation) {
let orgToRegisterOn: string | undefined = organization;
let userData: AddHumanUserRequest =
@@ -209,10 +212,6 @@ export default async function Page(props: {
}
}
if (link) {
return linkingFailed(branding);
}
// return login failed if no linking or creation is allowed and no user was found
return loginFailed(branding, "No user found");
}