diff --git a/libs/angular/src/vault/components/add-edit.component.ts b/libs/angular/src/vault/components/add-edit.component.ts index 45475440d0..255d553a3e 100644 --- a/libs/angular/src/vault/components/add-edit.component.ts +++ b/libs/angular/src/vault/components/add-edit.component.ts @@ -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", diff --git a/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.ts b/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.ts index eb34f820df..691b05be2b 100644 --- a/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.ts +++ b/libs/vault/src/cipher-form/components/login-details-section/login-details-section.component.ts @@ -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;