mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
feat(redirectToVaultIfUnlockedGuard): [Auth/PM-20623] RedirectToVaultIfUnlocked Guard (#15236)
Adds a `redirect-to-vault-if-unlocked.guard.ts` that does the following: - If there is no active user, allow access to the route - If the user is specifically Unlocked, redirect the user to /vault - Otherwise, allow access to the route (fallback/default)
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
authGuard,
|
||||
lockGuard,
|
||||
redirectGuard,
|
||||
redirectToVaultIfUnlockedGuard,
|
||||
tdeDecryptionRequiredGuard,
|
||||
unauthGuardFn,
|
||||
} from "@bitwarden/angular/auth/guards";
|
||||
@@ -454,6 +455,7 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: "login-with-device",
|
||||
canActivate: [redirectToVaultIfUnlockedGuard()],
|
||||
data: {
|
||||
pageIcon: DevicesIcon,
|
||||
pageTitle: {
|
||||
@@ -502,6 +504,7 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: "admin-approval-requested",
|
||||
canActivate: [redirectToVaultIfUnlockedGuard()],
|
||||
data: {
|
||||
pageIcon: DevicesIcon,
|
||||
pageTitle: {
|
||||
|
||||
Reference in New Issue
Block a user