mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:32:39 +00:00
fix redirect from loginname
This commit is contained in:
@@ -12,7 +12,7 @@ if (fs.existsSync(customConfigPath)) {
|
|||||||
customConfig = module.default;
|
customConfig = module.default;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.warn("Error loading custom configuration:", error);
|
console.warn("Could not find custom configuration:", error);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.info("No custom configuration file found!");
|
console.info("No custom configuration file found!");
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
|||||||
|
|
||||||
if (identityProviders.length === 1) {
|
if (identityProviders.length === 1) {
|
||||||
const host = headers().get("host");
|
const host = headers().get("host");
|
||||||
console.log("host", host);
|
|
||||||
const identityProviderType = identityProviders[0].type;
|
const identityProviderType = identityProviders[0].type;
|
||||||
|
|
||||||
const provider = idpTypeToSlug(identityProviderType);
|
const provider = idpTypeToSlug(identityProviderType);
|
||||||
@@ -109,9 +108,9 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
|||||||
params.set("loginName", command.loginName);
|
params.set("loginName", command.loginName);
|
||||||
}
|
}
|
||||||
|
|
||||||
const registerUrl = new URL("/register?" + params);
|
const registerUrl = "/register?" + params;
|
||||||
|
|
||||||
return redirect(registerUrl.toString());
|
return redirect(registerUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw Error("Could not find user");
|
throw Error("Could not find user");
|
||||||
|
|||||||
@@ -73,10 +73,16 @@ export default function UsernameForm({
|
|||||||
) {
|
) {
|
||||||
const response = await submitLoginName(values, organization);
|
const response = await submitLoginName(values, organization);
|
||||||
|
|
||||||
|
if (!response) {
|
||||||
|
setError("An internal error occurred");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (response?.authMethodTypes && response.authMethodTypes.length === 0) {
|
if (response?.authMethodTypes && response.authMethodTypes.length === 0) {
|
||||||
setError(
|
setError(
|
||||||
"User has no available authentication methods. Contact your administrator to setup authentication for the requested user.",
|
"User has no available authentication methods. Contact your administrator to setup authentication for the requested user.",
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response?.authMethodTypes.length == 1) {
|
if (response?.authMethodTypes.length == 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user