Itzik Grinboim
12/19/2025, 10:47 AMotp.update.phone.sms and then enters a wrong OTP in otp.verify.sms, the Descope session is lost — isAuthenticated flips to false and the user is logged out.
Because isAuthenticated (from the global state) changes to false, our try/catch doesn’t help — the app treats the user as logged out immediately.
Is this expected behavior?
Is there a recommended way to handle OTP verification failures without invalidating the existing session?
Thanks!Atharva Joshi
12/19/2025, 11:07 AMAtharva Joshi
12/19/2025, 11:08 AMItzik Grinboim
12/19/2025, 11:42 AMItzik Grinboim
12/19/2025, 11:43 AMAtharva Joshi
12/19/2025, 11:53 AMItzik Grinboim
12/19/2025, 12:07 PMconst resp = await descopeSdk.otp.update.phone.sms(
currentLoginId,
phoneNumber,
refreshToken,
{ addToLoginIDs: true, onMergeUseExisting: true }
);Itzik Grinboim
12/19/2025, 12:08 PMconst resp = await descopeSdk.otp.verify.sms(currentLoginId, code);Itzik Grinboim
12/19/2025, 12:09 PMItzik Grinboim
12/19/2025, 12:13 PMconst { isAuthenticated } = useSession();
It changes to false.Atharva Joshi
12/19/2025, 12:19 PMAtharva Joshi
12/22/2025, 7:56 AMItzik Grinboim
12/22/2025, 9:16 AM"@descope/react-sdk"
2.16.1Atharva Joshi
12/22/2025, 9:17 AMAtharva Joshi
12/24/2025, 9:47 AMDaniel Rachlin
12/24/2025, 6:32 PM"@descope/react-sdk": "^2.25.2" and this exact behavior that @Itzik Grinboim described is happening to me alsoAtharva Joshi
12/26/2025, 2:28 PMAtharva Joshi
12/26/2025, 2:28 PM