08743892d4
CI / build (push) Failing after 13m56s
- 관리자 페이지/스토어/API 삭제(adminAuth·adminMembers·adminStats·AdminLayout·pages/admin) - 라우터에서 /admin 경로·관리자 가드 제거 (사용자 앱 라우팅만 유지) - 공용 저수준(http put/del 등)은 dogs API 등이 사용하므로 유지 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
|
|
import MainLayout from '@/layouts/MainLayout.vue'
|
|
import { useAuthStore } from '@/stores/auth'
|
|
|
|
const routes: RouteRecordRaw[] = [
|
|
{
|
|
path: '/login',
|
|
name: 'login',
|
|
component: () => import('@/pages/LoginPage.vue'),
|
|
},
|
|
{
|
|
path: '/',
|
|
component: MainLayout,
|
|
meta: { requiresAuth: true },
|
|
children: [
|
|
{ path: '', name: 'home', component: () => import('@/pages/HomePage.vue') },
|
|
{ path: 'profile', name: 'profile', component: () => import('@/pages/ProfilePage.vue') },
|
|
],
|
|
},
|
|
]
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes,
|
|
})
|
|
|
|
// 소셜 로그인 전용 앱: 미로그인 시 보호 경로 접근 → 로그인으로
|
|
router.beforeEach((to) => {
|
|
const auth = useAuthStore()
|
|
if (to.meta.requiresAuth && !auth.isAuthenticated) {
|
|
return { name: 'login', query: { redirect: to.fullPath } }
|
|
}
|
|
if (to.name === 'login' && auth.isAuthenticated) {
|
|
return { name: 'home' }
|
|
}
|
|
})
|
|
|
|
export default router
|