mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Dynamic Modals (#417)
* Move backdrop and click handler to modal service since they should not be used in web * Add support for opening modals using ViewContainerRef
This commit is contained in:
@@ -26,7 +26,6 @@ export abstract class PlatformUtilsService {
|
||||
options?: any) => void;
|
||||
showDialog: (body: string, title?: string, confirmText?: string, cancelText?: string,
|
||||
type?: string, bodyIsHtml?: boolean) => Promise<boolean>;
|
||||
showPasswordDialog: (title: string, body: string, passwordValidation: (value: string) => Promise<boolean>) => Promise<boolean>;
|
||||
isDev: () => boolean;
|
||||
isSelfHost: () => boolean;
|
||||
copyToClipboard: (text: string, options?: any) => void | boolean;
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import { PlatformUtilsService } from '../abstractions';
|
||||
|
||||
import { CryptoService } from '../abstractions/crypto.service';
|
||||
import { I18nService } from '../abstractions/i18n.service';
|
||||
import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from '../abstractions/passwordReprompt.service';
|
||||
|
||||
import { HashPurpose } from '../enums/hashPurpose';
|
||||
|
||||
export class PasswordRepromptService implements PasswordRepromptServiceAbstraction {
|
||||
constructor(private i18nService: I18nService, private cryptoService: CryptoService,
|
||||
private platformUtilService: PlatformUtilsService) { }
|
||||
|
||||
protectedFields() {
|
||||
return ['TOTP', 'Password', 'H_Field', 'Card Number', 'Security Code'];
|
||||
}
|
||||
|
||||
async showPasswordPrompt() {
|
||||
const passwordValidator = (value: string) => {
|
||||
return this.cryptoService.compareAndUpdateKeyHash(value, null);
|
||||
};
|
||||
|
||||
return this.platformUtilService.showPasswordDialog(this.i18nService.t('passwordConfirmation'), this.i18nService.t('passwordConfirmationDesc'), passwordValidator);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user