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:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user