Registration and activation

This commit is contained in:
Torsten Schulz
2024-07-20 20:43:18 +02:00
parent 3880a265eb
commit bbf4a2deb3
51 changed files with 3016 additions and 69 deletions

View File

@@ -1,11 +1,17 @@
import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import ActivateView from '../views/auth/ActivateView.vue';
const routes = [
{
path: '/',
name: 'Home',
component: HomeView
},
{
path: '/activate',
name: 'Activate page',
component: ActivateView
}
];
@@ -18,8 +24,10 @@ router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
if (!store.getters.isLoggedIn) {
next('/');
} else {
} else if (!store.user.active) {
next();
} else {
next('/activate');
}
} else {
next();