refactor: remove pocketbase (#1138)

This commit is contained in:
Jonas Plum
2025-09-02 21:58:08 +02:00
committed by GitHub
parent f28c238135
commit eba2615ec0
435 changed files with 42677 additions and 4730 deletions
+47 -9
View File
@@ -1,44 +1,82 @@
import { createRouter, createWebHistory } from 'vue-router'
import DashboardView from '@/views/DashboardView.vue'
import { useAuthStore } from '@/store/auth'
import LoginView from '@/views/LoginView.vue'
import PasswordResetView from '@/views/PasswordResetView.vue'
import ReactionView from '@/views/ReactionView.vue'
import TicketView from '@/views/TicketView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
redirect: '/dashboard'
redirect: '/dashboard',
meta: { requiresAuth: true }
},
{
path: '/dashboard',
name: 'dashboard',
component: DashboardView
component: () => import('@/views/DashboardView.vue'),
meta: { requiresAuth: true }
},
{
path: '/tickets/:type/:id?',
name: 'tickets',
component: TicketView
component: () => import('@/views/TicketView.vue'),
meta: { requiresAuth: true }
},
{
path: '/reactions/:id?',
name: 'reactions',
component: ReactionView
component: () => import('@/views/ReactionView.vue'),
meta: { requiresAuth: true }
},
{
path: '/users/:id?',
name: 'users',
component: () => import('@/views/UserView.vue'),
meta: { requiresAuth: true }
},
{
path: '/groups/:id?',
name: 'groups',
component: () => import('@/views/GroupView.vue'),
meta: { requiresAuth: true }
},
{
path: '/types/:id?',
name: 'types',
component: () => import('@/views/TypeView.vue'),
meta: { requiresAuth: true }
},
{
path: '/settings',
name: 'settings',
component: () => import('@/views/SettingsView.vue'),
meta: { requiresAuth: true }
},
{
path: '/login',
name: 'login',
component: LoginView
component: LoginView,
meta: { requiresAuth: false }
},
{
path: '/password-reset',
name: 'password-reset',
component: PasswordResetView
component: PasswordResetView,
meta: { requiresAuth: false }
}
]
})
router.beforeEach((to, from, next) => {
const authStore = useAuthStore()
if (to.meta.requiresAuth && !authStore.isAuthenticated) {
next('/login')
} else {
next()
}
})
export default router