Skip to content
Snippets Groups Projects
Commit 2465538c authored by Jens Christian Aanestad's avatar Jens Christian Aanestad
Browse files

Merge branch 'refactor/Configuration' of...

Merge branch 'refactor/Configuration' of https://gitlab.stud.idi.ntnu.no/idatt2106-2024-07/frontend into refactor/Configuration
parents f5fa99c1 ae42edd2
No related branches found
No related tags found
1 merge request!25Refactor/configuration
Pipeline #275567 failed
......@@ -56,7 +56,7 @@ const handleSubmit = async () => {
});
await router.push({ name: 'home' });
} catch (error: any) {
errorMsg.value = handleUnknownError(error);
errorMsg.value = handleUnknownError(error);
}
}
......@@ -64,6 +64,10 @@ const handleSubmit = async () => {
<template>
<div class="container-fluid">
<div class="container-fluid d-flex justify-content-center align-items-center flex-column mt-5">
<img src="@/assets/Sparesti-logo.png" style="width: 300px">
<h1>Sparesti.no</h1>
</div>
<form ref="formRef" id="loginForm" @submit.prevent="handleSubmit" novalidate>
<BaseInput :model-value="emailRef"
......@@ -111,4 +115,8 @@ const handleSubmit = async () => {
#confirmButton {
margin: 1rem 0;
}
h1 {
font-size: 4rem;
}
</style>
\ No newline at end of file
......@@ -18,7 +18,6 @@ function toRoadmap(){
</script>
<template>
<Menu></Menu>
<div class="container text-center">
<div class="row">
<div class="col">
......@@ -120,7 +119,6 @@ function toRoadmap(){
</div>
</div>
</div>
<Footer></Footer>
</template>
<style scoped>
......
......@@ -16,11 +16,10 @@ const routes = [
{
path: '',
name: 'home',
component: () => import('../views/HomeView.vue'),
meta: { requiresAuth: true },
component: () => import('../views/SavingGoalView/RoadmapView.vue'),
},
{
path: '/news',
path: 'news',
name: 'news',
component: () => import('@/views/NewsView.vue'),
},
......@@ -49,11 +48,16 @@ const routes = [
name: 'shop',
component: () => import('@/views/ShopView.vue'),
},
{
path: '/profile',
name: 'profile',
component: UserProfileView
},
{
path: 'admin',
name: 'admin',
component: () => import('@/views/TestView.vue'),
meta: { requiresAdmin: true }
meta: { requiresAdmin: true },
},
{
path: 'unauthorized',
......@@ -72,11 +76,6 @@ const routes = [
name: 'login',
component: LoginView,
},
{
path: '/profile',
name: 'profile',
component: UserProfileView
},
{
path: '/sign-up',
name: 'sign up',
......@@ -135,18 +134,13 @@ router.beforeEach((to, from, next) => {
const userRole = user.role;
const isAuthenticated = user.isLoggedIn;
/*if (requiresAuth && !isAuthenticated) {
next({ name: 'login' });
if (requiresAuth && !isAuthenticated) {
next({ name: 'login', query: { redirect: to.fullPath } });
} else if (requiresAdmin && userRole !== 'admin') {
next({ name: 'unauthorized' });
} else {
if (requiresAdmin && userRole !== 'admin') {
next({ name: 'unauthorized' });
} else {
next();
}
}*/
next();
next();
}
});
export default router;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment