[Vue3] Router 에서 권한 체크해서 login 페이지로 보내기
router/index.js import {createRouter, createWebHistory} from 'vue-router' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/posts', component: PostsLayout, children: [ { path: 'new', component: PostsNew, // only authenticated users can create posts meta: { requiresAuth: true }, }, { path: ':id', component: PostsDetail, // anybody can read a po..
2023. 9. 5.