mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Add unlock using biometry to lock screen
This commit is contained in:
@@ -36,6 +36,11 @@
|
|||||||
{{'loggedInAsOn' | i18n : email : webVaultHostname}}
|
{{'loggedInAsOn' | i18n : email : webVaultHostname}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="box" *ngIf="biometricLock">
|
||||||
|
<div class="box-footer">
|
||||||
|
<a class="btn primary block" (click)="unlockBiometric()">Unlock with biometry</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<p class="text-center">
|
<p class="text-center">
|
||||||
<a href="#" appStopClick (click)="logOut()">{{'logOut' | i18n}}</a>
|
<a href="#" appStopClick (click)="logOut()">{{'logOut' | i18n}}</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { UserService } from 'jslib/abstractions/user.service';
|
|||||||
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||||
|
|
||||||
import { LockComponent as BaseLockComponent } from 'jslib/angular/components/lock.component';
|
import { LockComponent as BaseLockComponent } from 'jslib/angular/components/lock.component';
|
||||||
|
import Swal from 'sweetalert2';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-lock',
|
selector: 'app-lock',
|
||||||
@@ -36,4 +37,26 @@ export class LockComponent extends BaseLockComponent {
|
|||||||
document.getElementById(this.pinLock ? 'pin' : 'masterPassword').focus();
|
document.getElementById(this.pinLock ? 'pin' : 'masterPassword').focus();
|
||||||
}, 100);
|
}, 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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user