Skip to content

Commit

Permalink
revert to old secrets masking behaviour in browser cipher edit view (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jprusik authored Feb 23, 2024
1 parent c6b0f70 commit 44bda82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,15 @@ <h2 class="box-header">
<div class="row-main">
<label for="loginPassword">{{ "password" | i18n }}</label>
<input
*ngIf="showPassword"
id="loginPassword"
class="monospaced"
type="text"
type="{{ showPassword ? 'text' : 'password' }}"
name="Login.Password"
[(ngModel)]="cipher.login.password"
appInputVerbatim
[disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode"
/>
<div *ngIf="!showPassword" class="monospaced">
{{ cipher.login.maskedPassword || "••••••••" }}
</div>
</div>
<div class="action-buttons">
<button
Expand Down Expand Up @@ -153,18 +150,15 @@ <h2 class="box-header">
<div class="row-main">
<label for="loginTotp">{{ "authenticatorKeyTotp" | i18n }}</label>
<input
*ngIf="showTotpSeed"
id="loginTotp"
type="text"
type="{{ showTotpSeed ? 'text' : 'password' }}"
name="Login.Totp"
class="monospaced"
[(ngModel)]="cipher.login.totp"
appInputVerbatim
[disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode"
/>
<div *ngIf="!showTotpSeed" class="monospaced">
{{ cipher.login.maskedPassword || "••••••••" }}
</div>
</div>
<div class="action-buttons">
<button
Expand Down
10 changes: 0 additions & 10 deletions libs/angular/src/vault/components/add-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
if (!this.allowPersonal && this.organizationId == undefined) {
this.organizationId = this.defaultOwnerId;
}

this.resetMaskState();
}

async load() {
Expand Down Expand Up @@ -274,8 +272,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
this.cipher.secureNote.type = SecureNoteType.Generic;
this.cipher.reprompt = CipherRepromptType.None;
}

this.resetMaskState();
}

if (this.cipher != null && (!this.editMode || loadedAddEditCipherInfo || this.cloneMode)) {
Expand Down Expand Up @@ -517,12 +513,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
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() {
this.showPassword = !this.showPassword;

Expand Down

0 comments on commit 44bda82

Please sign in to comment.