first iteration on frontend, done by claude because i'm lazy with frontend

This commit is contained in:
2026-05-20 12:02:51 -06:00
parent 887ad1e981
commit 64efed0809
49 changed files with 11864 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import { createRouter, createWebHistory } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/login',
name: 'login',
component: () => import('@/pages/auth/LoginPage.vue'),
meta: { public: true },
},
{
path: '/auth/callback',
name: 'oauth-callback',
component: () => import('@/pages/auth/OAuthCallback.vue'),
meta: { public: true },
},
{
path: '/',
redirect: '/dashboard',
},
{
path: '/dashboard',
name: 'dashboard',
component: () => import('@/pages/dashboard/DashboardPage.vue'),
meta: { title: 'Dashboard' },
},
],
})
router.beforeEach((to) => {
const auth = useAuthStore()
if (!to.meta.public && !auth.isAuthenticated) {
return { name: 'login', query: { redirect: to.fullPath } }
}
if (to.name === 'login' && auth.isAuthenticated) {
return { name: 'dashboard' }
}
})
export default router