From 3dc09aff13d458837fe2c3a5689a830969e8aa67 Mon Sep 17 00:00:00 2001 From: Rakantor Date: Tue, 8 Nov 2022 23:04:03 +0100 Subject: [PATCH] Add help page link to footer --- components/FooterApp.vue | 1 + middleware/auth.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/FooterApp.vue b/components/FooterApp.vue index 90e8c20..016ce8d 100644 --- a/components/FooterApp.vue +++ b/components/FooterApp.vue @@ -3,6 +3,7 @@ © {{ new Date().getFullYear() }} + FAQ diff --git a/middleware/auth.js b/middleware/auth.js index 6b55c27..dae0fbb 100644 --- a/middleware/auth.js +++ b/middleware/auth.js @@ -1,11 +1,12 @@ export default function ({ $auth, store, route, redirect }) { + const noAuthRoutes = ['login', 'help'] // If Firebase Auth hasn't been initialized yet, redirect to index page if (!store.state.firebaseInitialized && route.name !== 'index') { return redirect({ name: 'index' }) } - // If the user attempts to access any site other than the login page without being logged in, + // If the user attempts to access any site other than those defined in noAuthRoutes without being logged in, // redirect to login page - else if (store.state.firebaseInitialized && (!$auth.currentUser && route.name !== 'login')) { + else if (store.state.firebaseInitialized && (!$auth.currentUser && !noAuthRoutes.includes(route.name))) { return redirect({ name: 'login' }) } } \ No newline at end of file