1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

Add unlock using biometry to lock screen

This commit is contained in:
Hinton
2020-10-11 20:42:09 +02:00
parent f311101ed9
commit 01ffa27fcc
2 changed files with 28 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import { UserService } from 'jslib/abstractions/user.service';
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
import { LockComponent as BaseLockComponent } from 'jslib/angular/components/lock.component';
import Swal from 'sweetalert2';
@Component({
selector: 'app-lock',
@@ -36,4 +37,26 @@ export class LockComponent extends BaseLockComponent {
document.getElementById(this.pinLock ? 'pin' : 'masterPassword').focus();
}, 100);
}
async unlockBiometric() {
if (!this.biometricLock) {
return;
}
const div = document.createElement('div');
div.innerHTML = `<div class="swal2-text">${this.i18nService.t('awaitDesktop')}</div>`;
const submitted = Swal.fire({
heightAuto: false,
buttonsStyling: false,
html: div,
showCancelButton: true,
cancelButtonText: this.i18nService.t('cancel'),
showConfirmButton: false,
});
await super.unlockBiometric();
Swal.close();
}
}