mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-03 18:28:13 +01:00
Display error message when biometric is disabled in the desktop
This commit is contained in:
parent
c13d6f810e
commit
d20aaeb0e5
@ -135,7 +135,7 @@ const eventService = new EventService(storageService, apiService, userService, c
|
||||
const systemService = new SystemService(storageService, vaultTimeoutService, messagingService, platformUtilsService,
|
||||
null);
|
||||
const nativeMessagingService = new NativeMessagingService(cryptoFunctionService, cryptoService, platformUtilsService,
|
||||
logService, i18nService, userService, messagingService);
|
||||
logService, i18nService, userService, messagingService, vaultTimeoutService);
|
||||
|
||||
const analytics = new Analytics(window, () => isDev(), platformUtilsService, storageService, appIdService);
|
||||
containerService.attachToGlobal(window);
|
||||
|
@ -1453,9 +1453,15 @@
|
||||
"verifyBrowserTitle": {
|
||||
"message": "Verify browser connection"
|
||||
},
|
||||
"verifyBrowserDescription": {
|
||||
"verifyBrowserDesc": {
|
||||
"message": "Please ensure the shown fingerprint is identical to the fingerprint showed in the browser extension."
|
||||
},
|
||||
"biometricsNotEnabledTitle": {
|
||||
"message": "Biometrics not enabled"
|
||||
},
|
||||
"biometricsNotEnabledDesc": {
|
||||
"message": "Browser biometric requires desktop biometric to be enabled in the settings first."
|
||||
},
|
||||
"personalOwnershipSubmitError": {
|
||||
"message": "Due to an Enterprise Policy, you are restricted from saving items to your personal vault. Change the Ownership option to an organization and choose from available Collections."
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import { LogService } from 'jslib/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||
|
||||
import { Utils } from 'jslib/misc/utils';
|
||||
import { SymmetricCryptoKey } from 'jslib/models/domain/symmetricCryptoKey';
|
||||
@ -20,7 +21,7 @@ export class NativeMessagingService {
|
||||
|
||||
constructor(private cryptoFunctionService: CryptoFunctionService, private cryptoService: CryptoService,
|
||||
private platformUtilService: PlatformUtilsService, private logService: LogService, private i18nService: I18nService,
|
||||
private userService: UserService, private messagingService: MessagingService) {
|
||||
private userService: UserService, private messagingService: MessagingService, private vaultTimeoutService: VaultTimeoutService) {
|
||||
ipcRenderer.on('nativeMessaging', async (event: any, message: any) => {
|
||||
this.messageHandler(message);
|
||||
});
|
||||
@ -40,7 +41,7 @@ export class NativeMessagingService {
|
||||
// Await confirmation that fingerprint is correct
|
||||
const submitted = await Swal.fire({
|
||||
title: this.i18nService.t('verifyBrowserTitle'),
|
||||
html: `${this.i18nService.t('verifyBrowserDescription')}<br><br><strong>${fingerprint}</strong>`,
|
||||
html: `${this.i18nService.t('verifyBrowserDesc')}<br><br><strong>${fingerprint}</strong>`,
|
||||
showCancelButton: true,
|
||||
cancelButtonText: this.i18nService.t('cancel'),
|
||||
showConfirmButton: true,
|
||||
@ -75,6 +76,18 @@ export class NativeMessagingService {
|
||||
return this.send({command: 'biometricUnlock', response: 'not supported'}, appId);
|
||||
}
|
||||
|
||||
if (! await this.vaultTimeoutService.isBiometricLockSet()) {
|
||||
this.send({command: 'biometricUnlock', response: 'not enabled'}, appId);
|
||||
|
||||
return await Swal.fire({
|
||||
title: this.i18nService.t('biometricsNotEnabledTitle'),
|
||||
text: this.i18nService.t('biometricsNotEnabledDesc'),
|
||||
showCancelButton: true,
|
||||
cancelButtonText: this.i18nService.t('cancel'),
|
||||
showConfirmButton: false,
|
||||
});
|
||||
}
|
||||
|
||||
const response = await this.platformUtilService.authenticateBiometric();
|
||||
if (response) {
|
||||
this.send({command: 'biometricUnlock', response: 'unlocked', keyB64: (await this.cryptoService.getKey()).keyB64}, appId);
|
||||
|
Loading…
Reference in New Issue
Block a user