From 41f7c5a4b38dacdf2d8fd75ce3a76dcaac2d25fb Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Mon, 9 Dec 2024 15:12:51 +0100 Subject: [PATCH] wait for 2 seconds --- apps/login/src/components/login-otp.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/login/src/components/login-otp.tsx b/apps/login/src/components/login-otp.tsx index 01ccee1bf0..d8afe203db 100644 --- a/apps/login/src/components/login-otp.tsx +++ b/apps/login/src/components/login-otp.tsx @@ -182,6 +182,9 @@ export function LoginOTP({ function setCodeAndContinue(values: Inputs, organization?: string) { return submitCode(values, organization).then(async (response) => { + // Wait for 2 seconds to avoid eventual consistency issues with an OTP code being verified in the /login endpoint + await new Promise((resolve) => setTimeout(resolve, 2000)); + if (response) { const url = authRequestId && response.sessionId