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