mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
Upgrade angular & friends (v15.2.9 ⮕ v16.2.12) (#424)
* Upgrade @angular packages to 16.2.12 Upgrade a webpack package * Rebuild package-lock.json * Remove use of deprecated Guard interfaces Update route guards to use mapToCanActivate
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
import { RouterModule, Routes, mapToCanActivate } from "@angular/router";
|
||||
|
||||
import { ApiKeyComponent } from "./accounts/apiKey.component";
|
||||
import { AuthGuardService } from "./services/auth-guard.service";
|
||||
@@ -14,7 +14,7 @@ const routes: Routes = [
|
||||
{
|
||||
path: "login",
|
||||
component: ApiKeyComponent,
|
||||
canActivate: [LaunchGuardService],
|
||||
canActivate: mapToCanActivate([LaunchGuardService]),
|
||||
},
|
||||
{
|
||||
path: "tabs",
|
||||
@@ -28,17 +28,17 @@ const routes: Routes = [
|
||||
{
|
||||
path: "dashboard",
|
||||
component: DashboardComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
canActivate: mapToCanActivate([AuthGuardService]),
|
||||
},
|
||||
{
|
||||
path: "settings",
|
||||
component: SettingsComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
canActivate: mapToCanActivate([AuthGuardService]),
|
||||
},
|
||||
{
|
||||
path: "more",
|
||||
component: MoreComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
canActivate: mapToCanActivate([AuthGuardService]),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { CanActivate } from "@angular/router";
|
||||
|
||||
import { MessagingService } from "@/jslib/common/src/abstractions/messaging.service";
|
||||
|
||||
import { StateService } from "../../abstractions/state.service";
|
||||
|
||||
@Injectable()
|
||||
export class AuthGuardService implements CanActivate {
|
||||
export class AuthGuardService {
|
||||
constructor(
|
||||
private stateService: StateService,
|
||||
private messagingService: MessagingService,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { CanActivate, Router } from "@angular/router";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
import { StateService } from "../../abstractions/state.service";
|
||||
|
||||
@Injectable()
|
||||
export class LaunchGuardService implements CanActivate {
|
||||
export class LaunchGuardService {
|
||||
constructor(
|
||||
private stateService: StateService,
|
||||
private router: Router,
|
||||
|
||||
Reference in New Issue
Block a user