1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

Auth/PM-13945 - Extension - Fix TDE User with MP can't navigate to Lock Screen (#11700)

* PM-13945 - Extension Refresh redirects should persist query params as we use query params to execute guard logic (e.g., lockGuard). The loss of the from: login-initiated query param prevented navigation to the lock screen.

* PM-13945 - Test updated
This commit is contained in:
Jared Snider
2024-10-25 11:29:48 -04:00
committed by GitHub
parent 3b82a82416
commit fa537638bf
3 changed files with 32 additions and 11 deletions

View File

@@ -12,9 +12,15 @@ export function extensionRefreshRedirect(redirectUrl: string): () => Promise<boo
return async () => {
const configService = inject(ConfigService);
const router = inject(Router);
const shouldRedirect = await configService.getFeatureFlag(FeatureFlag.ExtensionRefresh);
if (shouldRedirect) {
return router.parseUrl(redirectUrl);
const currentNavigation = router.getCurrentNavigation();
const queryParams = currentNavigation?.extras?.queryParams || {};
// Preserve query params when redirecting as it is likely that the refreshed component
// will be consuming the same query params.
return router.createUrlTree([redirectUrl], { queryParams });
} else {
return true;
}