Skip to content

Commit

Permalink
Fix system authentication setup
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Jan 16, 2025
1 parent ca420d7 commit 495de59
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions apps/desktop/src/app/accounts/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,24 @@ export class SettingsComponent implements OnInit, OnDestroy {
}
});

this.supportsBiometric =
(await this.biometricsService.getBiometricsStatus()) === BiometricsStatus.Available;
this.supportsBiometric = this.shouldAllowBiometricSetup(
await this.biometricsService.getBiometricsStatus(),
);
this.timerId = setInterval(async () => {
this.supportsBiometric =
(await this.biometricsService.getBiometricsStatus()) === BiometricsStatus.Available;
this.supportsBiometric = this.shouldAllowBiometricSetup(
await this.biometricsService.getBiometricsStatus(),
);
}, 1000);
}

private shouldAllowBiometricSetup(biometricStatus: BiometricsStatus): boolean {
return [
BiometricsStatus.Available,
BiometricsStatus.AutoSetupNeeded,
BiometricsStatus.ManualSetupNeeded,
].includes(biometricStatus);
}

async saveVaultTimeout(newValue: VaultTimeout) {
if (newValue === VaultTimeoutStringType.Never) {
const confirmed = await this.dialogService.openSimpleDialog({
Expand Down Expand Up @@ -485,6 +495,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
}

const status = await this.biometricsService.getBiometricsStatus();
this.logService.info("status", status);

if (status === BiometricsStatus.AutoSetupNeeded) {
await this.biometricsService.setupBiometrics();
Expand Down

0 comments on commit 495de59

Please sign in to comment.