1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 02:23:44 +00:00

Restructure the org-redirect guard to be Angular 17+ compliant (#9552)

* Document the `org-redirect` guard in code

* Make assertions about the way the `org-redirect` guard should behave

* Restructure the `org-redirect` guard to be Angular 17+ compliant

* Convert data parameter to function parameter

* Convert a data parameter to a function parameter that was missed

* Pass redirect function to default organization route
This commit is contained in:
Addison Beck
2024-07-01 11:54:00 -04:00
committed by GitHub
parent 71e8fdb73d
commit 9551691fde
5 changed files with 158 additions and 34 deletions

View File

@@ -11,7 +11,7 @@ import { UnsecuredWebsitesReportComponent } from "../../../admin-console/organiz
import { WeakPasswordsReportComponent } from "../../../admin-console/organizations/tools/weak-passwords-report.component";
import { IsPaidOrgGuard } from "../guards/is-paid-org.guard";
import { OrganizationPermissionsGuard } from "../guards/org-permissions.guard";
import { OrganizationRedirectGuard } from "../guards/org-redirect.guard";
import { organizationRedirectGuard } from "../guards/org-redirect.guard";
import { EventsComponent } from "../manage/events.component";
import { ReportsHomeComponent } from "./reports-home.component";
@@ -25,10 +25,7 @@ const routes: Routes = [
{
path: "",
pathMatch: "full",
canActivate: [OrganizationRedirectGuard],
data: {
autoRedirectCallback: getReportRoute,
},
canActivate: [organizationRedirectGuard(getReportRoute)],
children: [], // This is required to make the auto redirect work,
},
{