1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

Add show/hide button to password prompt (#1034)

This commit is contained in:
Oscar Hinton
2021-08-27 14:50:58 +02:00
committed by GitHub
parent 7c8e95d408
commit fa4e5250b9
41 changed files with 697 additions and 1234 deletions

View File

@@ -222,32 +222,6 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
return confirmed.value;
}
async showPasswordDialog(title: string, body: string, passwordValidation: (value: string) => Promise<boolean>):
Promise<boolean> {
const result = await Swal.fire({
heightAuto: false,
titleText: title,
input: 'password',
text: 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 passwordValidation(value)) {
return false;
}
return this.i18nService.t('invalidMasterPassword');
},
});
return result.isConfirmed;
}
isDev(): boolean {
return process.env.NODE_ENV === 'development';
}