mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 15:27:33 +00:00
cleanup
This commit is contained in:
@@ -52,7 +52,7 @@ export default async function Page(props: { searchParams: Promise<any> }) {
|
|||||||
(requestId ? `&requestId=${requestId}` : ""),
|
(requestId ? `&requestId=${requestId}` : ""),
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error("Could not send invitation email", error);
|
console.error("Could not send invitation email", error);
|
||||||
throw Error("Failed to send verification email");
|
throw Error("Failed to send invitation email");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await sendEmailCode({
|
await sendEmailCode({
|
||||||
@@ -160,19 +160,14 @@ export default async function Page(props: { searchParams: Promise<any> }) {
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* always show the code form, except code is an invite code and the email is verified */}
|
<VerifyForm
|
||||||
{invite === "true" && human?.email?.isVerified ? (
|
loginName={loginName}
|
||||||
<Alert type={AlertType.INFO}>{t("success")}</Alert>
|
organization={organization}
|
||||||
) : (
|
userId={id}
|
||||||
<VerifyForm
|
code={code}
|
||||||
loginName={loginName}
|
isInvite={invite === "true"}
|
||||||
organization={organization}
|
requestId={requestId}
|
||||||
userId={id}
|
/>
|
||||||
code={code}
|
|
||||||
isInvite={invite === "true"}
|
|
||||||
requestId={requestId}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</DynamicTheme>
|
</DynamicTheme>
|
||||||
);
|
);
|
||||||
|
@@ -255,23 +255,6 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
|||||||
|
|
||||||
// always resend invite if user has no auth method set
|
// always resend invite if user has no auth method set
|
||||||
if (!methods.authMethodTypes || !methods.authMethodTypes.length) {
|
if (!methods.authMethodTypes || !methods.authMethodTypes.length) {
|
||||||
// redirect to /verify invite if no auth method is set and email is not verified
|
|
||||||
// const inviteCheck = checkEmailVerified(
|
|
||||||
// session,
|
|
||||||
// humanUser,
|
|
||||||
// session.factors.user.organizationId,
|
|
||||||
// command.requestId,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// if (inviteCheck?.redirect) {
|
|
||||||
// return inviteCheck;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // check if user was verified recently
|
|
||||||
// const isUserVerified = await checkUserVerification(
|
|
||||||
// session.factors.user.id,
|
|
||||||
// );
|
|
||||||
// if (!isUserVerified) {
|
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
loginName: session.factors?.user?.loginName as string,
|
loginName: session.factors?.user?.loginName as string,
|
||||||
send: "true", // set this to true to request a new code immediately
|
send: "true", // set this to true to request a new code immediately
|
||||||
@@ -291,25 +274,6 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return { redirect: `/verify?` + params };
|
return { redirect: `/verify?` + params };
|
||||||
// }
|
|
||||||
|
|
||||||
// const paramsAuthenticatorSetup = new URLSearchParams({
|
|
||||||
// loginName: session.factors?.user?.loginName,
|
|
||||||
// userId: session.factors?.user?.id, // verify needs user id
|
|
||||||
// });
|
|
||||||
|
|
||||||
// if (command.organization || session.factors?.user?.organizationId) {
|
|
||||||
// paramsAuthenticatorSetup.append(
|
|
||||||
// "organization",
|
|
||||||
// command.organization ?? session.factors?.user?.organizationId,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (command.requestId) {
|
|
||||||
// paramsAuthenticatorSetup.append("requestId", command.requestId);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return { redirect: "/authenticator/set?" + paramsAuthenticatorSetup };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (methods.authMethodTypes.length == 1) {
|
if (methods.authMethodTypes.length == 1) {
|
||||||
|
Reference in New Issue
Block a user