From 2c62820101f7f85482655c950d5a79fdabcdaae4 Mon Sep 17 00:00:00 2001 From: Elias Crum Date: Thu, 23 May 2024 14:17:53 +0200 Subject: [PATCH] random changes --- src/components/Styling/TheHeader.vue | 83 ++++++++++++++++++++++++++-- src/router.ts | 25 +++++---- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/src/components/Styling/TheHeader.vue b/src/components/Styling/TheHeader.vue index 0f442c3..2f82bcb 100644 --- a/src/components/Styling/TheHeader.vue +++ b/src/components/Styling/TheHeader.vue @@ -1,21 +1,87 @@ diff --git a/src/router.ts b/src/router.ts index 9a20422..19993a3 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,5 +1,4 @@ import { createRouter, createWebHistory } from "vue-router"; -import { Component, defineAsyncComponent } from "vue"; import LandingPage from "./components/LandingPage.vue"; // import TheFooter from './components/Styling/TheFooter.vue' @@ -27,34 +26,34 @@ const router = createRouter({ path: "/", redirect: { name: "Home" } }, - { - name: "Login Page", - path: "login", - components: { default: PodLogin }, - }, { name: "Home", - path: "home", + path: "/home", components: { default: LandingPage }, }, + { + name: "Login Page", + path: "/login", + components: { default: PodLogin }, + }, { name: "Data Upload", - path: "dataUpload", + path: "/dataUpload", components: { default: PodUpload }, }, { name: "Pod Browser", - path: "podBrowser", + path: "/podBrowser", components: { default: PodBrowser }, }, { name: "Query", - path: "dataQuery", + path: "/dataQuery", components: { default: DataQuery }, }, { name: "Data Privacy", - path: "privacy", + path: "/privacy", components: { default: EditPrivacy }, }, { @@ -73,7 +72,9 @@ const router = createRouter({ setTimeout(() => { router.beforeEach(function (to, from, next) { // make sure the user is authenticated - if (!isLoggedin() && to.name !== "Login Page") { + if (!isLoggedin() && to.name !== "Login Page" && to.name !== "Home") { + next({ name: "Login Page" }); + } else if ( !isLoggedin() && to.name !== "Login Page" ) { next({ name: "Login Page" }); } else if (isLoggedin() && to.name === "Login Page") { next({ name: "Home" });