[PR #5500] [MERGED] [PM-23546] Update 2FA verification code accept any length #5819

Closed
opened 2025-11-27 00:14:50 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5500
Author: @andrebispo5
Created: 7/9/2025
Status: Merged
Merged: 7/14/2025
Merged by: @andrebispo5

Base: mainHead: pm-23546/verification-6-digit-code


📝 Commits (3)

  • 3592576 [PM-23546] Update 2FA verification code to not check for length and update copy to be length invariant.
  • ea1c9c5 [PM-23546] Use stringResource
  • 5484175 [PM-23546] Add test to continue button state based on code.

📊 Changes

4 files changed (+9 additions, -12 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginScreen.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginViewModel.kt (+1 -3)
📝 app/src/main/res/values/strings.xml (+1 -1)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginViewModelTest.kt (+6 -7)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-23546

📔 Objective

Currently, the Android app is hardcoded to accept 8 digits for new device verification and 6 digits for 2fa verification. However, we are migrating our new device verification to use 6 digits.
To support this and any future changes, we should update this field to allow any length input. The correct code will work and anything else will return an “incorrect code” error.
Screen copy should also be updated to be length invariant:
We don't recognize this device. Enter the code sent to your email to verify your identity.

📸 Screenshots

https://github.com/user-attachments/assets/3ae143bb-c0be-42c8-b71b-763f35faca4b

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/5500 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 7/9/2025 **Status:** ✅ Merged **Merged:** 7/14/2025 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `main` ← **Head:** `pm-23546/verification-6-digit-code` --- ### 📝 Commits (3) - [`3592576`](https://github.com/bitwarden/android/commit/3592576396d7089bd04d8d94afe12abcb479746c) [PM-23546] Update 2FA verification code to not check for length and update copy to be length invariant. - [`ea1c9c5`](https://github.com/bitwarden/android/commit/ea1c9c5a470d28ecb69dea46011bc4a57b1349d6) [PM-23546] Use stringResource - [`5484175`](https://github.com/bitwarden/android/commit/5484175287b4e4059c5fae78363f45357e103081) [PM-23546] Add test to continue button state based on code. ### 📊 Changes **4 files changed** (+9 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginScreen.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginViewModel.kt` (+1 -3) 📝 `app/src/main/res/values/strings.xml` (+1 -1) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginViewModelTest.kt` (+6 -7) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/PM-23546 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> Currently, the Android app is hardcoded to accept 8 digits for new device verification and 6 digits for 2fa verification. However, we are migrating our new device verification to use 6 digits. To support this and any future changes, we should update this field to allow any length input. The correct code will work and anything else will return an “incorrect code” error. Screen copy should also be updated to be length invariant: `We don't recognize this device. Enter the code sent to your email to verify your identity.` ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> https://github.com/user-attachments/assets/3ae143bb-c0be-42c8-b71b-763f35faca4b ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-27 00:14:50 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5819