diff --git a/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html b/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html index 256aec34b50..76a2d466369 100644 --- a/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html +++ b/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html @@ -36,6 +36,7 @@ [ngClass]="{ 'tw-hidden': passwordRevealed }" readonly bitInput + #passwordInput type="password" [value]="cipher.login.password" aria-readonly="true" diff --git a/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.ts b/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.ts index 5eeb3f9e8f3..9a40caf031b 100644 --- a/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.ts +++ b/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.ts @@ -3,12 +3,14 @@ import { CommonModule, DatePipe } from "@angular/common"; import { Component, + ElementRef, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges, + ViewChild, } from "@angular/core"; import { Observable, switchMap } from "rxjs"; @@ -61,6 +63,8 @@ export class LoginCredentialsViewComponent implements OnChanges { @Input() activeUserId: UserId; @Input() hadPendingChangePasswordTask: boolean; @Output() handleChangePassword = new EventEmitter(); + @ViewChild("passwordInput") + private passwordInput!: ElementRef; isPremium$: Observable = this.accountService.activeAccount$.pipe( switchMap((account) => @@ -92,6 +96,10 @@ export class LoginCredentialsViewComponent implements OnChanges { ngOnChanges(changes: SimpleChanges): void { if (changes["cipher"]) { + if (this.passwordInput?.nativeElement) { + // Reset password input type in case it's been toggled + this.passwordInput.nativeElement.type = "password"; + } this.passwordRevealed = false; this.showPasswordCount = false; }