Skip to content

[PM-18612] Consolidate all email OTP to use 6 digits #5967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

trmartin4
Copy link
Member

@trmartin4 trmartin4 commented Jun 14, 2025

🎟️ Tracking

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

📔 Objective

Currently the base EmailTokenProvider uses 8 digits for the OTP, and the EmalTwoFactorTokenProvider overrides this with 6.

As we have more users using the EmailTokenProvider for New Device Verification, we have been asked to change this to 6 digits as well. This allows us to consolidate the implementation and not override any of the token parameters on the child class.

The EmailTokenProvider is used:

  • On New Device Verification
  • When an OTP is required for User Verification (user does not have a master password)

To improve clarity on why we are inheriting in the EmailTwoFactorTokenProvider, I added a comment to explain what it does relative to its base class. I did not elect to refactor this inheritance at this point.

📸 Screenshots

otp_user_verification.mov
otp_new_device_verification.mov

⏰ 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

@trmartin4 trmartin4 changed the title Change email OTP to 6 digits [PM-18612] Consolidate all email OTP to use 6 digits Jun 14, 2025
Copy link
Contributor

github-actions bot commented Jun 14, 2025

Logo
Checkmarx One – Scan Summary & Detailsd45d8e46-379c-46c8-8101-312f44c02d65

New Issues (5)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
HIGH Path_Traversal /src/Api/Tools/Controllers/SendsController.cs: 211
detailsMethod PostFile at line 211 of /src/Api/Tools/Controllers/SendsController.cs gets dynamic data from the model element. This element’s value then ...
ID: keY0wh5knH3DnvbREmfJIGGig2k%3D
Attack Vector
HIGH Path_Traversal /src/Api/Tools/Controllers/SendsController.cs: 211
detailsMethod PostFile at line 211 of /src/Api/Tools/Controllers/SendsController.cs gets dynamic data from the model element. This element’s value then ...
ID: 4QIsZ8agHxuL%2BFjdf49NpZJHsvU%3D
Attack Vector
HIGH Path_Traversal /src/Api/Tools/Controllers/SendsController.cs: 211
detailsMethod PostFile at line 211 of /src/Api/Tools/Controllers/SendsController.cs gets dynamic data from the model element. This element’s value then ...
ID: Uwek2GQ3fAsDgtQkgYKs2Vkocog%3D
Attack Vector
HIGH Path_Traversal /src/Api/Tools/Controllers/SendsController.cs: 211
detailsMethod PostFile at line 211 of /src/Api/Tools/Controllers/SendsController.cs gets dynamic data from the model element. This element’s value then ...
ID: OxfkMdVQRO3StOFifYOfb36o2%2Bw%3D
Attack Vector
HIGH Path_Traversal /src/Api/Tools/Controllers/SendsController.cs: 211
detailsMethod PostFile at line 211 of /src/Api/Tools/Controllers/SendsController.cs gets dynamic data from the model element. This element’s value then ...
ID: HvNxhQLOT4P0U2Lbp6HqePXg%2FNQ%3D
Attack Vector

Copy link

codecov bot commented Jun 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.59%. Comparing base (91b4ef7) to head (2f8897e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5967      +/-   ##
==========================================
- Coverage   47.59%   47.59%   -0.01%     
==========================================
  Files        1676     1676              
  Lines       74741    74737       -4     
  Branches     6753     6753              
==========================================
- Hits        35574    35570       -4     
  Misses      37707    37707              
  Partials     1460     1460              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trmartin4 trmartin4 marked this pull request as ready for review June 19, 2025 01:46
@trmartin4 trmartin4 requested a review from a team as a code owner June 19, 2025 01:46
@trmartin4 trmartin4 requested a review from rr-bw June 19, 2025 01:46
Copy link

@rr-bw rr-bw requested review from ike-kottlowski and removed request for rr-bw June 20, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants