revert to old secrets masking behaviour in browser cipher edit view (#8018)

This commit is contained in:
Jonathan Prusik 2024-02-23 17:40:27 -05:00 committed by GitHub
parent c6b0f70a26
commit 44bda82bc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 20 deletions

View File

@ -70,18 +70,15 @@
<div class="row-main"> <div class="row-main">
<label for="loginPassword">{{ "password" | i18n }}</label> <label for="loginPassword">{{ "password" | i18n }}</label>
<input <input
*ngIf="showPassword"
id="loginPassword" id="loginPassword"
class="monospaced" class="monospaced"
type="text" type="{{ showPassword ? 'text' : 'password' }}"
name="Login.Password" name="Login.Password"
[(ngModel)]="cipher.login.password" [(ngModel)]="cipher.login.password"
appInputVerbatim appInputVerbatim
[disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode" [readonly]="!cipher.edit && editMode"
/> />
<div *ngIf="!showPassword" class="monospaced">
{{ cipher.login.maskedPassword || "••••••••" }}
</div>
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
<button <button
@ -153,18 +150,15 @@
<div class="row-main"> <div class="row-main">
<label for="loginTotp">{{ "authenticatorKeyTotp" | i18n }}</label> <label for="loginTotp">{{ "authenticatorKeyTotp" | i18n }}</label>
<input <input
*ngIf="showTotpSeed"
id="loginTotp" id="loginTotp"
type="text" type="{{ showTotpSeed ? 'text' : 'password' }}"
name="Login.Totp" name="Login.Totp"
class="monospaced" class="monospaced"
[(ngModel)]="cipher.login.totp" [(ngModel)]="cipher.login.totp"
appInputVerbatim appInputVerbatim
[disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode" [readonly]="!cipher.edit && editMode"
/> />
<div *ngIf="!showTotpSeed" class="monospaced">
{{ cipher.login.maskedPassword || "••••••••" }}
</div>
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
<button <button

View File

@ -226,8 +226,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
if (!this.allowPersonal && this.organizationId == undefined) { if (!this.allowPersonal && this.organizationId == undefined) {
this.organizationId = this.defaultOwnerId; this.organizationId = this.defaultOwnerId;
} }
this.resetMaskState();
} }
async load() { async load() {
@ -274,8 +272,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
this.cipher.secureNote.type = SecureNoteType.Generic; this.cipher.secureNote.type = SecureNoteType.Generic;
this.cipher.reprompt = CipherRepromptType.None; this.cipher.reprompt = CipherRepromptType.None;
} }
this.resetMaskState();
} }
if (this.cipher != null && (!this.editMode || loadedAddEditCipherInfo || this.cloneMode)) { if (this.cipher != null && (!this.editMode || loadedAddEditCipherInfo || this.cloneMode)) {
@ -517,12 +513,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
return true; return true;
} }
resetMaskState() {
// toggle masks off for maskable login properties with no value on init/load
this.showTotpSeed = !this.cipher?.login?.totp;
this.showPassword = !this.cipher?.login?.password;
}
togglePassword() { togglePassword() {
this.showPassword = !this.showPassword; this.showPassword = !this.showPassword;