Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PS-1066] Browser and Desktop - SSO User does not see Update Master Password screen after Owner does a Admin Password Reset #3207

Merged
merged 10 commits into from
Aug 5, 2022
Merged
13 changes: 11 additions & 2 deletions apps/browser/src/popup/accounts/lock.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { LogService } from "@bitwarden/common/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { StateService } from "@bitwarden/common/abstractions/state.service";
import { SyncService } from "@bitwarden/common/abstractions/sync.service";
import { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout.service";
import { AuthenticationStatus } from "@bitwarden/common/enums/authenticationStatus";

Expand All @@ -26,6 +27,8 @@ export class LockComponent extends BaseLockComponent {

biometricError: string;
pendingBiometric = false;
authenicatedUrl = "/tabs/current";
unAuthenicatedUrl = "/update-temp-password";

constructor(
router: Router,
Expand All @@ -40,7 +43,8 @@ export class LockComponent extends BaseLockComponent {
logService: LogService,
keyConnectorService: KeyConnectorService,
ngZone: NgZone,
private authService: AuthService
private authService: AuthService,
private syncService: SyncService
) {
super(
router,
Expand All @@ -56,12 +60,17 @@ export class LockComponent extends BaseLockComponent {
keyConnectorService,
ngZone
);
this.successRoute = "/tabs/current";

this.isInitialLockScreen = (window as any).previousPopupUrl == null;
}

async ngOnInit() {
await super.ngOnInit();
await this.syncService.fullSync(true);

const forcePasswordReset = await this.stateService.getForcePasswordReset();
this.successRoute = forcePasswordReset === true ? this.unAuthenicatedUrl : this.authenicatedUrl;

cyprain-okeke marked this conversation as resolved.
Show resolved Hide resolved
const disableAutoBiometricsPrompt =
(await this.stateService.getDisableAutoBiometricsPrompt()) ?? true;

Expand Down
11 changes: 10 additions & 1 deletion apps/desktop/src/app/accounts/lock.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { LogService } from "@bitwarden/common/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { StateService } from "@bitwarden/common/abstractions/state.service";
import { SyncService } from "@bitwarden/common/abstractions/sync.service";
import { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout.service";

const BroadcasterSubscriptionId = "LockComponent";
Expand All @@ -23,6 +24,8 @@ const BroadcasterSubscriptionId = "LockComponent";
})
export class LockComponent extends BaseLockComponent implements OnDestroy {
private deferFocus: boolean = null;
authenicatedUrl = "vault";
unAuthenicatedUrl = "update-temp-password";

constructor(
router: Router,
Expand All @@ -38,7 +41,8 @@ export class LockComponent extends BaseLockComponent implements OnDestroy {
private broadcasterService: BroadcasterService,
ngZone: NgZone,
logService: LogService,
keyConnectorService: KeyConnectorService
keyConnectorService: KeyConnectorService,
private syncService: SyncService
) {
super(
router,
Expand All @@ -60,6 +64,11 @@ export class LockComponent extends BaseLockComponent implements OnDestroy {
await super.ngOnInit();
const autoPromptBiometric = !(await this.stateService.getNoAutoPromptBiometrics());

await this.syncService.fullSync(true);

const forcePasswordReset = await this.stateService.getForcePasswordReset();
this.successRoute = forcePasswordReset === true ? this.unAuthenicatedUrl : this.authenicatedUrl;

cyprain-okeke marked this conversation as resolved.
Show resolved Hide resolved
this.route.queryParams.subscribe((params) => {
if (this.supportsBiometric && params.promptBiometric && autoPromptBiometric) {
setTimeout(async () => {
Expand Down