style: fix linting issues met Prettier
This commit is contained in:
parent
7b356c5ddd
commit
d555144681
1 changed files with 12 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
||||||
import {createRouter, createWebHistory} from "vue-router";
|
import { createRouter, createWebHistory } from "vue-router";
|
||||||
import MenuBar from "@/components/MenuBar.vue";
|
import MenuBar from "@/components/MenuBar.vue";
|
||||||
import StudentHomepage from "@/views/homepage/StudentHomepage.vue";
|
import StudentHomepage from "@/views/homepage/StudentHomepage.vue";
|
||||||
import SingleAssignment from "@/views/assignments/SingleAssignment.vue";
|
import SingleAssignment from "@/views/assignments/SingleAssignment.vue";
|
||||||
|
@ -21,24 +21,24 @@ const router = createRouter({
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "home",
|
name: "home",
|
||||||
component: () => import("../views/HomePage.vue"),
|
component: () => import("../views/HomePage.vue"),
|
||||||
meta: {requiresAuth: false}
|
meta: { requiresAuth: false },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/login",
|
path: "/login",
|
||||||
name: "LoginPage",
|
name: "LoginPage",
|
||||||
component: () => import("../views/LoginPage.vue"),
|
component: () => import("../views/LoginPage.vue"),
|
||||||
meta: {requiresAuth: false},
|
meta: { requiresAuth: false },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/callback",
|
path: "/callback",
|
||||||
component: CallbackPage,
|
component: CallbackPage,
|
||||||
meta: {requiresAuth: false}
|
meta: { requiresAuth: false },
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/user",
|
path: "/user",
|
||||||
component: MenuBar,
|
component: MenuBar,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "home",
|
path: "home",
|
||||||
|
@ -67,49 +67,48 @@ const router = createRouter({
|
||||||
path: "/assignment/create",
|
path: "/assignment/create",
|
||||||
name: "CreateAssigment",
|
name: "CreateAssigment",
|
||||||
component: CreateAssignment,
|
component: CreateAssignment,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/assignment/:id",
|
path: "/assignment/:id",
|
||||||
name: "SingleAssigment",
|
name: "SingleAssigment",
|
||||||
component: SingleAssignment,
|
component: SingleAssignment,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/class/create",
|
path: "/class/create",
|
||||||
name: "CreateClass",
|
name: "CreateClass",
|
||||||
component: CreateClass,
|
component: CreateClass,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/class/:id",
|
path: "/class/:id",
|
||||||
name: "SingleClass",
|
name: "SingleClass",
|
||||||
component: SingleClass,
|
component: SingleClass,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/discussion/create",
|
path: "/discussion/create",
|
||||||
name: "CreateDiscussion",
|
name: "CreateDiscussion",
|
||||||
component: CreateDiscussion,
|
component: CreateDiscussion,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/discussion/:id",
|
path: "/discussion/:id",
|
||||||
name: "SingleDiscussion",
|
name: "SingleDiscussion",
|
||||||
component: SingleDiscussion,
|
component: SingleDiscussion,
|
||||||
meta: {requiresAuth: true},
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/:catchAll(.*)",
|
path: "/:catchAll(.*)",
|
||||||
name: "NotFound",
|
name: "NotFound",
|
||||||
component: NotFound,
|
component: NotFound,
|
||||||
meta: {requiresAuth: false}
|
meta: { requiresAuth: false },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
|
||||||
// Verify if user is logged in for paths that require access
|
// Verify if user is logged in for paths that require access
|
||||||
if (to.meta.requiresAuth) {
|
if (to.meta.requiresAuth) {
|
||||||
if (!authState.isLoggedIn) {
|
if (!authState.isLoggedIn) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue