1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

PM-1391-Added previous-url to global-state (#5733)

* added previous-url to global-state

* updated storage of previousUrl for SSO/MFA flows

* revert file changes

* added post login routing

* Clear PreviousUrl from storage on new Login

* Components do not call StateService anymore

* removed needed query params

* refactored components to use RouterService

* fixed build error

* fixed mfa component

* updated logic for previous Url

* removed unneeded base implementation

* Added state call for Redirect Guard

* Fixed test cases

* Remove routing service calls

* renamed global field, changed routing to guard

* reverting constructor changes and git lint issue

* fixing constructor ordering

* fixing diffs to be clearer on actual cahnges.

* addressing accepting emergency access case

* refactor and add locked state logic

* refactor name of guard to be more clear

* Added comments and tests

* comments + support lock page deep linking + code ownership

* readability updates

* Combined guards and specs updated routing

* Update oss-routing.module.ts

* fixed stroybook build
This commit is contained in:
Ike
2023-11-22 08:54:12 -08:00
committed by GitHub
parent a6e3d4d244
commit f1691a5ef1
14 changed files with 321 additions and 90 deletions

View File

@@ -18,6 +18,8 @@ import { FamiliesForEnterpriseSetupComponent } from "./admin-console/organizatio
import { CreateOrganizationComponent } from "./admin-console/settings/create-organization.component";
import { SponsoredFamiliesComponent } from "./admin-console/settings/sponsored-families.component";
import { AcceptOrganizationComponent } from "./auth/accept-organization.component";
import { AcceptEmergencyComponent } from "./auth/emergency-access/accept/accept-emergency.component";
import { deepLinkGuard } from "./auth/guards/deep-link.guard";
import { HintComponent } from "./auth/hint.component";
import { LockComponent } from "./auth/lock.component";
import { LoginDecryptionOptionsComponent } from "./auth/login/login-decryption-options/login-decryption-options.component";
@@ -113,16 +115,19 @@ const routes: Routes = [
{
path: "lock",
component: LockComponent,
canActivate: [lockGuard()],
canActivate: [deepLinkGuard(), lockGuard()],
},
{ path: "verify-email", component: VerifyEmailTokenComponent },
{
path: "accept-organization",
component: AcceptOrganizationComponent,
canActivate: [deepLinkGuard()],
data: { titleId: "joinOrganization", doNotSaveUrl: false },
},
{
path: "accept-emergency",
component: AcceptEmergencyComponent,
canActivate: [deepLinkGuard()],
data: { titleId: "acceptEmergency", doNotSaveUrl: false },
loadComponent: () =>
import("./auth/emergency-access/accept/accept-emergency.component").then(
@@ -132,6 +137,7 @@ const routes: Routes = [
{
path: "accept-families-for-enterprise",
component: AcceptFamilySponsorshipComponent,
canActivate: [deepLinkGuard()],
data: { titleId: "acceptFamilySponsorship", doNotSaveUrl: false },
},
{ path: "recover", pathMatch: "full", redirectTo: "recover-2fa" },
@@ -188,7 +194,7 @@ const routes: Routes = [
{
path: "",
component: UserLayoutComponent,
canActivate: [AuthGuard],
canActivate: [deepLinkGuard(), AuthGuard],
children: [
{
path: "vault",