mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 10:55:12 +00:00
fix(login): preserve OIDC request context during email verification (#11990)
# Which Problems Are Solved When a user needed to verify their email during an OIDC login flow, the requestId was lost, preventing the flow from completing with a redirect back to the relying party. # How the Problems Are Solved In `sendVerification()`, the session cookie lookup used `"loginName" in command` to decide whether to fall back to `user.preferredLoginName`. Since the `loginName` property key always exists in the command object (even when its value is undefined), the fallback was never triggered. This caused the lookup to search for loginName === undefined, finding no session — and ultimately redirecting to a dead-end success page. - /authenticator/set redirect: Added missing requestId to the URL params when redirecting users who need to set up a primary auth method. - /verify/success page: Added a "Continue" button that re-enters the login flow with requestId preserved, handling the edge case where no session cookie exists (e.g. email link opened in a different browser).
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Button, ButtonVariants } from "./button";
|
||||
|
||||
type Props = {
|
||||
continueUrl: string;
|
||||
};
|
||||
|
||||
export function VerifySuccessContinue({ continueUrl }: Props) {
|
||||
const router = useRouter();
|
||||
const t = useTranslations("verify");
|
||||
|
||||
return (
|
||||
<div className="mt-8 flex w-full flex-row items-center justify-end">
|
||||
<Button
|
||||
type="button"
|
||||
variant={ButtonVariants.Primary}
|
||||
onClick={() => router.push(continueUrl)}
|
||||
data-testid="continue-button"
|
||||
>
|
||||
{t("successContinue")}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user