diff --git a/src/pages/auth/VerificationStep.tsx b/src/pages/auth/VerificationStep.tsx index f9d34c98..8172e7be 100644 --- a/src/pages/auth/VerificationStep.tsx +++ b/src/pages/auth/VerificationStep.tsx @@ -38,9 +38,17 @@ const VerificationStep: FC = ({ feedbackEmail, email, cal return; } - window.location.href = `/api/auth/callback/email?email=${encodeURIComponent( + const otp = otpForm.getValues().otp; + const params = new URLSearchParams({ email, - )}&token=${otpForm.getValues().otp}${callbackUrl ? `&callbackUrl=${callbackUrl}` : ''}`; + token: otp, + }); + + if (callbackUrl) { + params.append('callbackUrl', callbackUrl); + } + + window.location.href = `/api/auth/callback/email?${params.toString()}`; }, [email, otpForm, callbackUrl, t]); const feedbackEmailLink = useMemo(() => `mailto:${feedbackEmail}`, [feedbackEmail]);