mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PS-1066] Browser and Desktop - SSO User does not see Update Master Password screen after Owner does a Admin Password Reset (#3207)
* added a refresh token to avoid the time out issue * validating for forcePasswordReset for web extension * checking for forcePasswordReset to know the successRoute to nagivate to * changes after running prettier * removing the old implementation and making changes for getForcePasswordReset * making chnages to lock.component in desktop project for forcePasswordReset Co-authored-by: dynwee <onwudiweokeke@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import { LogService } from "@bitwarden/common/abstractions/log.service";
|
|||||||
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
|
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "@bitwarden/common/abstractions/state.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 { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout.service";
|
||||||
import { AuthenticationStatus } from "@bitwarden/common/enums/authenticationStatus";
|
import { AuthenticationStatus } from "@bitwarden/common/enums/authenticationStatus";
|
||||||
|
|
||||||
@@ -26,6 +27,8 @@ export class LockComponent extends BaseLockComponent {
|
|||||||
|
|
||||||
biometricError: string;
|
biometricError: string;
|
||||||
pendingBiometric = false;
|
pendingBiometric = false;
|
||||||
|
authenicatedUrl = "/tabs/current";
|
||||||
|
unAuthenicatedUrl = "/update-temp-password";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
router: Router,
|
router: Router,
|
||||||
@@ -40,7 +43,8 @@ export class LockComponent extends BaseLockComponent {
|
|||||||
logService: LogService,
|
logService: LogService,
|
||||||
keyConnectorService: KeyConnectorService,
|
keyConnectorService: KeyConnectorService,
|
||||||
ngZone: NgZone,
|
ngZone: NgZone,
|
||||||
private authService: AuthService
|
private authService: AuthService,
|
||||||
|
private syncService: SyncService
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
router,
|
router,
|
||||||
@@ -56,12 +60,17 @@ export class LockComponent extends BaseLockComponent {
|
|||||||
keyConnectorService,
|
keyConnectorService,
|
||||||
ngZone
|
ngZone
|
||||||
);
|
);
|
||||||
this.successRoute = "/tabs/current";
|
|
||||||
this.isInitialLockScreen = (window as any).previousPopupUrl == null;
|
this.isInitialLockScreen = (window as any).previousPopupUrl == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
await super.ngOnInit();
|
await super.ngOnInit();
|
||||||
|
await this.syncService.fullSync(true);
|
||||||
|
|
||||||
|
const forcePasswordReset = await this.stateService.getForcePasswordReset();
|
||||||
|
this.successRoute = forcePasswordReset === true ? this.unAuthenicatedUrl : this.authenicatedUrl;
|
||||||
|
|
||||||
const disableAutoBiometricsPrompt =
|
const disableAutoBiometricsPrompt =
|
||||||
(await this.stateService.getDisableAutoBiometricsPrompt()) ?? true;
|
(await this.stateService.getDisableAutoBiometricsPrompt()) ?? true;
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { LogService } from "@bitwarden/common/abstractions/log.service";
|
|||||||
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
|
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "@bitwarden/common/abstractions/state.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 { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout.service";
|
||||||
|
|
||||||
const BroadcasterSubscriptionId = "LockComponent";
|
const BroadcasterSubscriptionId = "LockComponent";
|
||||||
@@ -23,6 +24,8 @@ const BroadcasterSubscriptionId = "LockComponent";
|
|||||||
})
|
})
|
||||||
export class LockComponent extends BaseLockComponent implements OnDestroy {
|
export class LockComponent extends BaseLockComponent implements OnDestroy {
|
||||||
private deferFocus: boolean = null;
|
private deferFocus: boolean = null;
|
||||||
|
authenicatedUrl = "vault";
|
||||||
|
unAuthenicatedUrl = "update-temp-password";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
router: Router,
|
router: Router,
|
||||||
@@ -38,7 +41,8 @@ export class LockComponent extends BaseLockComponent implements OnDestroy {
|
|||||||
private broadcasterService: BroadcasterService,
|
private broadcasterService: BroadcasterService,
|
||||||
ngZone: NgZone,
|
ngZone: NgZone,
|
||||||
logService: LogService,
|
logService: LogService,
|
||||||
keyConnectorService: KeyConnectorService
|
keyConnectorService: KeyConnectorService,
|
||||||
|
private syncService: SyncService
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
router,
|
router,
|
||||||
@@ -60,6 +64,11 @@ export class LockComponent extends BaseLockComponent implements OnDestroy {
|
|||||||
await super.ngOnInit();
|
await super.ngOnInit();
|
||||||
const autoPromptBiometric = !(await this.stateService.getNoAutoPromptBiometrics());
|
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;
|
||||||
|
|
||||||
this.route.queryParams.subscribe((params) => {
|
this.route.queryParams.subscribe((params) => {
|
||||||
if (this.supportsBiometric && params.promptBiometric && autoPromptBiometric) {
|
if (this.supportsBiometric && params.promptBiometric && autoPromptBiometric) {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user