Skip to content

Commit

Permalink
fix webcams routeguard config
Browse files Browse the repository at this point in the history
  • Loading branch information
jabelone committed Sep 26, 2023
1 parent 2f58155 commit 9ab95b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src-frontend/src/boot/routeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default boot(({ router, store }) => {
if (
store.getters['profile/profile']?.memberStatus === 'Needs Induction' &&
to.name !== 'membershipPlan' &&
to.name !== 'webcams' &&
store.getters['config/features']?.enableMembershipPayments &&
to.meta.admin !== true
) {
Expand All @@ -25,7 +26,7 @@ export default boot(({ router, store }) => {
}

// Check if the user must be logged in to access the route
if (to.meta.loggedIn === true) {
if (to.meta.loggedIn === true && to.name !== 'webcams') {
if (store.getters['profile/loggedIn'] === true) return next();
else {
return next({
Expand All @@ -49,6 +50,7 @@ export default boot(({ router, store }) => {
// check if the user must be a member
if (
to.meta.memberOnly &&
to.name !== 'webcams' &&
store.getters['profile/profile'].memberStatus !== 'Active'
)
return next({ name: 'Error403MemberOnly' });
Expand Down
2 changes: 1 addition & 1 deletion src-frontend/src/pages/pageAndRouteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const PageAndRouteConfig: PageAndRouteConfigType[] = [
icon: icons.webcams,
to: '/webcams',
name: 'webcams',
loggedIn: false,
loggedIn: true,
kiosk: true,
featureEnabledFlag: 'enableWebcams',
component: () => import('pages/Webcams.vue'),
Expand Down

0 comments on commit 9ab95b3

Please sign in to comment.