[PR #2865] [PM-4794] Trim TOTP key #3851

Closed
opened 2025-11-26 23:37:54 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2865

State: closed
Merged: No


Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

This PR resolves #2122.
When cloning a working entry that has a valid OTP and editing the cloned entry by putting a space at the beginning of otpauth:// a wrong OTP is generated.

Code changes

  • TotpService.cs: The expected behaviour would be to still have a valid otp and therefore the whitespaces are trimmed.
    Thanks to @FlorianLang06

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/2865 **State:** closed **Merged:** No --- ## Type of change - [x] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> This PR resolves #2122. When cloning a working entry that has a valid OTP and editing the cloned entry by putting a space at the beginning of otpauth:// a wrong OTP is generated. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **TotpService.cs:** The expected behaviour would be to still have a valid otp and therefore the whitespaces are trimmed. Thanks to @FlorianLang06 ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:37:54 -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#3851