mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
Add password show/hide to reprompt (#1902)
Co-authored-by: Addison Beck <abeck@bitwarden.com>
This commit is contained in:
@@ -106,8 +106,6 @@ export class AppComponent implements OnInit {
|
||||
});
|
||||
} else if (msg.command === 'showDialog') {
|
||||
await this.showDialog(msg);
|
||||
} else if (msg.command === 'showPasswordDialog') {
|
||||
await this.showPasswordDialog(msg);
|
||||
} else if (msg.command === 'showToast') {
|
||||
this.ngZone.run(() => {
|
||||
this.showToast(msg);
|
||||
@@ -251,30 +249,4 @@ export class AppComponent implements OnInit {
|
||||
confirmed: confirmed.value,
|
||||
});
|
||||
}
|
||||
|
||||
private async showPasswordDialog(msg: any) {
|
||||
const platformUtils = this.platformUtilsService as BrowserPlatformUtilsService;
|
||||
const result = await Swal.fire({
|
||||
heightAuto: false,
|
||||
titleText: msg.title,
|
||||
input: 'password',
|
||||
text: msg.body,
|
||||
confirmButtonText: this.i18nService.t('ok'),
|
||||
showCancelButton: true,
|
||||
cancelButtonText: this.i18nService.t('cancel'),
|
||||
inputAttributes: {
|
||||
autocapitalize: 'off',
|
||||
autocorrect: 'off',
|
||||
},
|
||||
inputValidator: async (value: string): Promise<any> => {
|
||||
if (await platformUtils.resolvePasswordDialogPromise(msg.dialogId, false, value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.i18nService.t('invalidMasterPassword');
|
||||
},
|
||||
});
|
||||
|
||||
platformUtils.resolvePasswordDialogPromise(msg.dialogId, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user