1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[PM-739] Using a space at the beginning of otpauth:// generate a wrong OTP (#11204)

* Trimmed tariling whitespace from totp field

* Trimmed tariling whitespace from totp field

* Fix failing test
This commit is contained in:
SmithThe4th
2024-09-23 16:45:53 -04:00
committed by GitHub
parent 073fd29206
commit 0db179e974
2 changed files with 6 additions and 1 deletions

View File

@@ -329,6 +329,11 @@ export class AddEditComponent implements OnInit, OnDestroy {
this.cipher.card.expYear = normalizeExpiryYearFormat(this.cipher.card.expYear);
}
// trim whitespace from the TOTP field
if (this.cipher.type === this.cipherType.Login && this.cipher.login.totp) {
this.cipher.login.totp = this.cipher.login.totp.trim();
}
if (this.cipher.name == null || this.cipher.name === "") {
this.platformUtilsService.showToast(
"error",