diff --git a/packages/experience/src/pages/VerificationCode/index.tsx b/packages/experience/src/pages/VerificationCode/index.tsx index 3ea18c30028..311eacede4c 100644 --- a/packages/experience/src/pages/VerificationCode/index.tsx +++ b/packages/experience/src/pages/VerificationCode/index.tsx @@ -21,15 +21,19 @@ const VerificationCode = () => { const { flow } = useParams(); const { signInMethods } = useSieMethods(); - const { identifierInputValue } = useContext(UserInteractionContext); + const { identifierInputValue, forgotPasswordIdentifierInputValue } = + useContext(UserInteractionContext); - const [, useFlow] = validate(flow, userFlowGuard); + const [, userFlow] = validate(flow, userFlowGuard); - if (!useFlow) { + if (!userFlow) { return ; } - const { type, value } = identifierInputValue ?? {}; + const cachedIdentifierInputValue = + flow === UserFlow.ForgotPassword ? forgotPasswordIdentifierInputValue : identifierInputValue; + + const { type, value } = cachedIdentifierInputValue ?? {}; if (!type || type === SignInIdentifier.Username || !value) { return ; @@ -53,10 +57,10 @@ const VerificationCode = () => { }} > );