auth: support mobile paste in segmented code input - #204
Conversation
🦋 Changeset detectedLatest commit: 63ede11 The changes in this PR will be included in the next version bump. 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe OTP login flow now uses one real ChangesOTP input flow
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant codeInput
participant LoginPage
participant otpSlots
participant Verification
User->>codeInput: paste or autofill complete code
codeInput->>LoginPage: input and selection events
LoginPage->>otpSlots: normalize value and render slots
LoginPage->>Verification: auto-submit complete code
Verification-->>LoginPage: verification result
LoginPage->>codeInput: refocus after failure or step change
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 30956341598Coverage increased (+1.1%) to 59.018%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
|
🚅 Deployed to the ePDS-pr-204 environment in ePDS
|
|
(reply generated by OpenAI Codex) Addressed the SonarCloud finding reported in this comment in |
|
@coderabbitai please review |
|
✅ Action performedReview finished.
|
|
@coderabbitai please review |
|
✅ Action performedReview finished.
|
|
(reply generated by OpenAI Codex) Regarding the latest CodeRabbit review:
|
|
(reply generated by OpenAI Codex) Regarding the requested-changes review: addressed in |
|
@aspiers was working on the css parser to maintain backwards compatibility since duplicate inputs dont really work. However the css parser feels very fragile and also janky and adds a lot more code. Im leaning towards closing this pr and keeping the separate inputs and fixing the copy-paste only without the accessibility and navigation fixes. One alternative here is to maybe have a field in the client metadata which is a field like let me know what you think |
b6bb55d to
b30781f
Compare
|
@Kzoeps commented on Aug 4, 2026, 14:51 GMT+1:
What parser is that? If you really needed to parse CSS, I would say use treesitter, but that sounds overkill in this case since it's such a simple change needed - I would have thought a basic regexp search would do the job? Probably easiest is search-and-replace, or it could automatically switch modes based on the search result.
I'm not a fan of that because you would need it to default to the old version in order to achieve backwards compatibility, which would mean that every client wanting the new recommended version would have to explicitly request it. If there is a concrete reason why a simple regexp search doesn't work, I'd like to discuss that before considering other options, because I have a fairly strong intuition that it should work. |
b30781f to
24dd529
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This comment has been minimized.
This comment has been minimized.
Use one full-length input behind visual OTP slots so mobile paste and one-time-code autofill preserve the complete code. Keep keyboard replacement, client branding, and existing browser-driven flows compatible.
Project common legacy input selectors onto visual slots while keeping the real OTP input protected for paste, autofill, and hit testing.
Use fixed browser style signatures, log parser failures at debug level, and lock in keyframe compatibility.
24dd529 to
63ede11
Compare
|
Search and replace works but we need to know the exact css customization from each of the consumers. For now I have
Makes sense.
I think if we do it for the 4 apps mentioned above and based on their css write the regex then it would work. can switch it to that since i think the apps are maybe the only users of certified.one for now? |
|
@Kzoeps commented on Aug 5, 2026, 08:55 GMT+1:
Why? Doesn't it only have to replace
Probably that's good enough but we can survey all our trusted client brandings and check.
We don't need to touch more general selectors like .otp-box {
&:focus ...? What other combinations do we have to worry about in the absence of a parser?
Bit more than just those 4 but the nice thing is that we have the exact list of trusted clients so we can do a 100% reliable check! Would you be able to do that? |



Summary
Closes #212
Testing
pnpm typecheckpnpm lintpnpm test— 1,057 tests passedpnpm test:coverageSummary by CodeRabbit
Summary by CodeRabbit
Summary by CodeRabbit