Repository navigation
fix(ui): guard OTP Continue submissions and clean up dead slot disabled state - #11084
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: f7e29f2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
c5250bb to
f7e29f2
Compare


Description
Clicking the Continue button on prebuilt OTP verification screens could burn verification attempts or clear partial input when a user clicked before entering a full code.
In
useFieldOTP,onFakeContinueunconditionally calledparamsOnCodeEntryFinished('', resolve, reject), sending an empty verification attempt to FAPI even when the code was empty, partial, in flight, or waiting to reset after an error.onFakeContinuenow returns without submitting when a request is in flight or when all digits are already entered (auto-submit already handles complete codes), and otherwise sets a localform_param_nil(Enter code.) error on the code field without hitting FAPI.In
OTPCodeControl, this also removes an orphaneddisabledstate latch (useEffectsettingdisabled = trueon any truthyfeedbackwith no reset) along with itsreact-hooks/set-state-in-effectentry inpackages/ui/eslint-suppressions.json, derivingOTPInputSlot'sisDisabledprop directly fromisDisabled || isLoading || feedbackType === 'success'.DivInputdoes not currently renderisDisabled, so this part is dead-state cleanup rather than a visible slot-lockout fix.To verify, run
pnpm --filter @clerk/ui test src/elements/__tests__/CodeControl.test.tsx,pnpm --filter @clerk/ui lint, andpnpm --filter @clerk/ui type-check.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
✎