работаем бля работаем
This commit is contained in:
21
new-client/src/app/bootstrap/app.ts
Normal file
21
new-client/src/app/bootstrap/app.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { useAuth } from '@shared/composables/use-auth'
|
||||
import { createApp } from 'vue'
|
||||
import App from '../App.vue'
|
||||
import routerPlugin, { router } from '../plugins/router'
|
||||
|
||||
const mountPoint = '#app'
|
||||
|
||||
export default async function () {
|
||||
const { authorized } = useAuth()
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(routerPlugin)
|
||||
|
||||
await router.isReady()
|
||||
|
||||
if (!authorized.value && router.currentRoute.value.meta.auth === undefined) {
|
||||
router.push('/auth/login')
|
||||
}
|
||||
|
||||
app.mount(mountPoint)
|
||||
}
|
||||
Reference in New Issue
Block a user