feat: первое подключение фронтенда
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 54s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 27s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s

This commit is contained in:
2026-05-11 01:33:38 +03:00
parent 71e7d84e0f
commit 779b6aba77
21 changed files with 942 additions and 365 deletions
+10 -1
View File
@@ -5,6 +5,12 @@ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{ path: '/login', name: 'login', component: () => import('@/views/auth/LoginView.vue'), meta: { public: true } },
{
path: '/auth/callback',
name: 'auth-callback',
component: () => import('@/views/auth/AuthCallbackView.vue'),
meta: { public: true },
},
// Student
{ path: '/', name: 'dashboard', component: () => import('@/views/student/DashboardView.vue'), meta: { role: 'student' } },
@@ -31,8 +37,11 @@ const router = createRouter({
],
})
router.beforeEach((to) => {
router.beforeEach(async (to) => {
const auth = useAuthStore()
if (!auth.initialized && !to.meta.public) {
await auth.initialize()
}
if (!to.meta.public && !auth.isAuthenticated) {
return '/login'
}