@@ -14,12 +19,15 @@
+
+
\ No newline at end of file
diff --git a/frontend/src/router.js b/frontend/src/router.js
index 1602093..9d8f707 100644
--- a/frontend/src/router.js
+++ b/frontend/src/router.js
@@ -2,6 +2,7 @@ import {createRouter, createWebHistory} from 'vue-router'
import Index from '@/views/Index.vue';
import Login from '@/views/Login.vue';
import Register from '@/views/Register.vue';
+import store from '@/store';
const routes = [
@@ -20,7 +21,7 @@ const router = createRouter({
router.beforeEach((to/*, from*/) => {
// instead of having to check every route record with
// to.matched.some(record => record.meta.requiresAuth)
- if (to.meta.requiresAuth && false) {
+ if (to.meta.requiresAuth && !store.getters.isLoggedIn) {
// this route requires auth, check if logged in
// if not, redirect to login page.
console.log("Not logged in, redirecting to login page")
diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue
index 7a2097b..b53ec8e 100644
--- a/frontend/src/views/Login.vue
+++ b/frontend/src/views/Login.vue
@@ -24,7 +24,9 @@
+