mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
Add password show/hide to reprompt (#1902)
Co-authored-by: Addison Beck <abeck@bitwarden.com>
This commit is contained in:
@@ -150,33 +150,6 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||
});
|
||||
}
|
||||
|
||||
async showPasswordDialog(title: string, body: string, passwordValidation: (value: string) => Promise<boolean>) {
|
||||
const dialogId = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
|
||||
|
||||
this.messagingService.send('showPasswordDialog', {
|
||||
title: title,
|
||||
body: body,
|
||||
dialogId: dialogId,
|
||||
});
|
||||
|
||||
return new Promise<boolean>(resolve => {
|
||||
this.passwordDialogResolves.set(dialogId, {
|
||||
tryResolve: async (canceled: boolean, password: string) => {
|
||||
if (canceled) {
|
||||
resolve(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (await passwordValidation(password)) {
|
||||
resolve(true);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
date: new Date(),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
isDev(): boolean {
|
||||
return process.env.ENV === 'development';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user