1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[PM-15882] Remove unlock with PIN policy (#13352)

* Remove policy with PIN in Web Vault

* Remove policy with PIN in Browser Extension

* Remove policy with PIN in Desktop

* Remove policy with PIN in Desktop

* unit tests coverage

* unit tests coverage

* unit tests coverage

* private access method error

* private access method error

* private access method error

* PM-18498: Unlock Options Padding Off When PIN Is Removed

* PM-18498: Unlock Options Padding Off When PIN Is Removed
This commit is contained in:
Maciej Zieniuk
2025-02-21 22:16:13 +01:00
committed by GitHub
parent 3800610bb6
commit 78202e14ae
21 changed files with 747 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
// @ts-strict-ignore
import { Component, OnDestroy, OnInit } from "@angular/core";
import { FormBuilder } from "@angular/forms";
import { BehaviorSubject, Observable, Subject, firstValueFrom } from "rxjs";
import { BehaviorSubject, Observable, Subject, firstValueFrom, of } from "rxjs";
import {
concatMap,
debounceTime,
@@ -99,6 +99,8 @@ export class SettingsComponent implements OnInit, OnDestroy {
userHasMasterPassword: boolean;
userHasPinSet: boolean;
pinEnabled$: Observable<boolean> = of(true);
form = this.formBuilder.group({
// Security
vaultTimeout: [null as VaultTimeout | null],
@@ -262,6 +264,12 @@ export class SettingsComponent implements OnInit, OnDestroy {
// Load initial values
this.userHasPinSet = await this.pinService.isPinSet(activeAccount.id);
this.pinEnabled$ = this.policyService.get$(PolicyType.RemoveUnlockWithPin).pipe(
map((policy) => {
return policy == null || !policy.enabled;
}),
);
const initialValues = {
vaultTimeout: await firstValueFrom(
this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(activeAccount.id),