mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-07 22:55:12 +00:00
# Which Problems Are Solved This PR deprecates and replaces the use of `allowUsernamePassword` with `allowLocalAuthentication`. It additionally disables the username on organizations that disallow local authentication. In such a case, only IDPs are shown. # How the Problems Are Solved - replace `allowUsernamePassword` by `allowLocalAuthentication` - disable username form if !allowLocalAuthentication - translate property in console UI
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import { LoginSettings, PasskeysType } from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
|
import { AuthenticationMethodType } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
|
|
import { Alert, AlertType } from "./alert";
|
|
import { PASSKEYS, PASSWORD } from "./auth-methods";
|
|
import { Translated } from "./translated";
|
|
|
|
type Props = {
|
|
authMethods: AuthenticationMethodType[];
|
|
params: URLSearchParams;
|
|
loginSettings: LoginSettings;
|
|
};
|
|
|
|
export function ChooseAuthenticatorToSetup({ authMethods, params, loginSettings }: Props) {
|
|
if (authMethods.length !== 0) {
|
|
return (
|
|
<Alert type={AlertType.ALERT}>
|
|
<Translated i18nKey="allSetup" namespace="authenticator" />
|
|
</Alert>
|
|
);
|
|
} else {
|
|
return (
|
|
<div className="grid w-full grid-cols-1 gap-5 pt-4">
|
|
{!authMethods.includes(AuthenticationMethodType.PASSWORD) &&
|
|
loginSettings.allowLocalAuthentication &&
|
|
PASSWORD(false, "/password/set?" + params)}
|
|
{!authMethods.includes(AuthenticationMethodType.PASSKEY) &&
|
|
loginSettings.passkeysType == PasskeysType.ALLOWED &&
|
|
PASSKEYS(false, "/passkey/set?" + params)}
|
|
</div>
|
|
);
|
|
}
|
|
}
|