mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-25 12:15:18 +01: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:
parent
073fd29206
commit
0db179e974
@ -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",
|
||||
|
@ -125,7 +125,7 @@ export class LoginDetailsSectionComponent implements OnInit {
|
||||
Object.assign(cipher.login, {
|
||||
username: value.username,
|
||||
password: value.password,
|
||||
totp: value.totp,
|
||||
totp: value.totp?.trim(),
|
||||
} as LoginView);
|
||||
|
||||
return cipher;
|
||||
|
Loading…
Reference in New Issue
Block a user