Skip to content

Commit be1083a

Browse files
committed
fix(verify): block auto-verify while a resend is in flight (restore parity)
1 parent e9e84af commit be1083a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

apps/sim/app/(auth)/verify/use-verification.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,20 @@ export function useVerification({
201201
}
202202

203203
useEffect(() => {
204-
if (otp.length === 6 && email && status !== 'verifying' && status !== 'verified') {
204+
if (
205+
otp.length === 6 &&
206+
email &&
207+
status !== 'verifying' &&
208+
status !== 'verified' &&
209+
!isResending
210+
) {
205211
const timeoutId = setTimeout(() => {
206212
verifyCode()
207213
}, 300)
208214

209215
return () => clearTimeout(timeoutId)
210216
}
211-
}, [otp, email, status])
217+
}, [otp, email, status, isResending])
212218

213219
useEffect(() => {
214220
if (typeof window !== 'undefined') {

0 commit comments

Comments
 (0)