mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-10 16:15:12 +00:00
# Which Problems Are Solved Invalid formatting in the login codebase due to invalid prettier configuration # How the Problems Are Solved Fxed .prettierignore wildcards for login source files # Additional Changes Removed .prettierrc file because there is already a prettier.config.mjs file # Additional Context
32 lines
1.2 KiB
TypeScript
32 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 { PASSKEYS, PASSWORD } from "./auth-methods";
|
|
import { Translated } from "./translated";
|
|
|
|
type Props = {
|
|
authMethods: AuthenticationMethodType[];
|
|
params: URLSearchParams;
|
|
loginSettings: LoginSettings | undefined;
|
|
};
|
|
|
|
export function ChooseAuthenticatorToLogin({ authMethods, params, loginSettings }: Props) {
|
|
return (
|
|
<>
|
|
{authMethods.includes(AuthenticationMethodType.PASSWORD) && loginSettings?.allowLocalAuthentication && (
|
|
<div className="ztdl-p">
|
|
<Translated i18nKey="chooseAlternativeMethod" namespace="idp" />
|
|
</div>
|
|
)}
|
|
<div className="grid w-full grid-cols-1 gap-5 pt-4">
|
|
{authMethods.includes(AuthenticationMethodType.PASSWORD) &&
|
|
loginSettings?.allowLocalAuthentication &&
|
|
PASSWORD(false, "/password?" + params)}
|
|
{authMethods.includes(AuthenticationMethodType.PASSKEY) &&
|
|
loginSettings?.allowLocalAuthentication &&
|
|
loginSettings?.passkeysType == PasskeysType.ALLOWED &&
|
|
PASSKEYS(false, "/passkey?" + params)}
|
|
</div>
|
|
</>
|
|
);
|
|
}
|