mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-12 10:14:10 +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);
|
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 === "") {
|
if (this.cipher.name == null || this.cipher.name === "") {
|
||||||
this.platformUtilsService.showToast(
|
this.platformUtilsService.showToast(
|
||||||
"error",
|
"error",
|
||||||
|
@ -125,7 +125,7 @@ export class LoginDetailsSectionComponent implements OnInit {
|
|||||||
Object.assign(cipher.login, {
|
Object.assign(cipher.login, {
|
||||||
username: value.username,
|
username: value.username,
|
||||||
password: value.password,
|
password: value.password,
|
||||||
totp: value.totp,
|
totp: value.totp?.trim(),
|
||||||
} as LoginView);
|
} as LoginView);
|
||||||
|
|
||||||
return cipher;
|
return cipher;
|
||||||
|
Loading…
Reference in New Issue
Block a user