mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 07:24:51 +00:00
promptPasswordless check
This commit is contained in:
@@ -171,7 +171,6 @@ export default function PasswordForm({
|
|||||||
|
|
||||||
return router.push(`/passkey/add?` + params);
|
return router.push(`/passkey/add?` + params);
|
||||||
} else if (loginSettings?.forceMfa && !availableSecondFactors.length) {
|
} else if (loginSettings?.forceMfa && !availableSecondFactors.length) {
|
||||||
console.log("force setup mfa");
|
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
loginName: resp.factors.user.loginName,
|
loginName: resp.factors.user.loginName,
|
||||||
checkAfter: "true", // this defines if the check is directly made after the setup
|
checkAfter: "true", // this defines if the check is directly made after the setup
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import { useForm } from "react-hook-form";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { Spinner } from "./Spinner";
|
import { Spinner } from "./Spinner";
|
||||||
import Alert from "./Alert";
|
import Alert from "./Alert";
|
||||||
import { LoginSettings } from "@zitadel/proto/zitadel/settings/v2beta/login_settings_pb";
|
import {
|
||||||
|
LoginSettings,
|
||||||
|
PasskeysType,
|
||||||
|
} from "@zitadel/proto/zitadel/settings/v2beta/login_settings_pb";
|
||||||
|
|
||||||
type Inputs = {
|
type Inputs = {
|
||||||
loginName: string;
|
loginName: string;
|
||||||
@@ -77,6 +80,7 @@ export default function UsernameForm({
|
|||||||
values: Inputs,
|
values: Inputs,
|
||||||
organization?: string,
|
organization?: string,
|
||||||
) {
|
) {
|
||||||
|
console.log(loginSettings);
|
||||||
return submitLoginName(values, organization).then((response) => {
|
return submitLoginName(values, organization).then((response) => {
|
||||||
if (response.authMethodTypes.length == 1) {
|
if (response.authMethodTypes.length == 1) {
|
||||||
const method = response.authMethodTypes[0];
|
const method = response.authMethodTypes[0];
|
||||||
@@ -90,8 +94,13 @@ export default function UsernameForm({
|
|||||||
paramsPassword.organization = organization;
|
paramsPassword.organization = organization;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loginSettings?.passkeysType === 1) {
|
if (
|
||||||
paramsPassword.promptPasswordless = `true`; // PasskeysType.PASSKEYS_TYPE_ALLOWED,
|
loginSettings?.passkeysType &&
|
||||||
|
(loginSettings?.passkeysType === PasskeysType.ALLOWED ||
|
||||||
|
(loginSettings.passkeysType as string) ===
|
||||||
|
"PASSKEYS_TYPE_ALLOWED")
|
||||||
|
) {
|
||||||
|
paramsPassword.promptPasswordless = `true`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authRequestId) {
|
if (authRequestId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user