diff --git a/frontend/src/components/VaultList.vue b/frontend/src/components/VaultList.vue index b316b0f6..21e5ec23 100644 --- a/frontend/src/components/VaultList.vue +++ b/frontend/src/components/VaultList.vue @@ -40,7 +40,7 @@
- + {{ t('vaultList.addVault') }} @@ -147,8 +147,8 @@ const roleOfSelectedVault = computed(() => { } }); -const isAdmin = ref(); -const canCreateVaults = ref(); +const isAdmin = ref(false); +const canCreateVaults = ref(false); const licenseStatus = ref(); const isLicenseViolated = computed(() => { if (licenseStatus.value) { diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 7393afde..fefc4511 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -17,11 +17,12 @@ import VaultList from '../components/VaultList.vue'; import Forbidden from '../components/Forbidden.vue'; function checkRole(role: string): NavigationGuardWithThis { - return async () => { + return async (to, _) => { const auth = await authPromise; if (auth.hasRole(role)) { return true; } else { + console.warn(`Access denied: User requires role ${role} to access ${to.fullPath}`); return { path: '/app/forbidden', replace: true }; } };