mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-15 19:33:44 +00:00
fix tests
This commit is contained in:
@@ -25,7 +25,7 @@ export function ChooseAuthenticatorToSetup({
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
{loginSettings.passkeysType === PasskeysType.ALLOWED &&
|
||||
{loginSettings.passkeysType === PasskeysType.NOT_ALLOWED &&
|
||||
!loginSettings.allowUsernamePassword && (
|
||||
<Alert type={AlertType.ALERT}>{t("noMethodsAvailable")}</Alert>
|
||||
)}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import { Alert } from "@/components/alert";
|
||||
import { resendVerification, sendVerification } from "@/lib/server/email";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Button, ButtonVariants } from "./button";
|
||||
@@ -35,8 +34,6 @@ export function VerifyForm({ userId, code, isInvite, params }: Props) {
|
||||
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
async function resendCode() {
|
||||
setError("");
|
||||
setLoading(true);
|
||||
|
||||
@@ -74,7 +74,7 @@ export async function sendVerification(command: VerifyUserByEmailCommand) {
|
||||
if (session.factors?.user?.loginName) {
|
||||
params.set("loginName", session.factors?.user?.loginName);
|
||||
}
|
||||
return redirect("/authenticator/set?" + params);
|
||||
return redirect(`/authenticator/set?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +134,6 @@ export async function sendVerificationRedirectWithoutCheck(command: {
|
||||
if (session.factors?.user?.loginName) {
|
||||
params.set("loginName", session.factors?.user?.loginName);
|
||||
}
|
||||
return redirect("/authenticator/set?" + params);
|
||||
return redirect(`/authenticator/set?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,13 +54,7 @@ export async function registerUser(command: RegisterUserCommand) {
|
||||
checks,
|
||||
undefined,
|
||||
command.authRequestId,
|
||||
).then((session) => {
|
||||
return {
|
||||
userId: human.userId,
|
||||
sessionId: session.id,
|
||||
factors: session.factors,
|
||||
};
|
||||
});
|
||||
);
|
||||
|
||||
if (!session || !session.factors?.user) {
|
||||
return { error: "Could not create session" };
|
||||
@@ -83,9 +77,9 @@ export async function registerUser(command: RegisterUserCommand) {
|
||||
organization: session.factors.user.organizationId,
|
||||
});
|
||||
|
||||
if (command.authRequestId && session.userId) {
|
||||
if (command.authRequestId && session.factors.user.id) {
|
||||
params.append("authRequest", command.authRequestId);
|
||||
params.append("sessionId", session.sessionId);
|
||||
params.append("sessionId", session.id);
|
||||
|
||||
return redirect("/login?" + params);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user