mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 05:28:13 +00:00
poprawki bezpieczeństwa
This commit is contained in:
+18
-2
@@ -1,9 +1,25 @@
|
||||
import { createApp } from 'vue';
|
||||
import router from './router';
|
||||
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
|
||||
import { createPinia } from 'pinia';
|
||||
import { useStore } from './store';
|
||||
|
||||
createApp(App).use(router).use(createPinia()).mount('#app');
|
||||
const pinia = createPinia();
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(pinia).use(router);
|
||||
app.mount('#app');
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const store = useStore();
|
||||
|
||||
if (to.meta.protected && !store.user) {
|
||||
next('/login');
|
||||
return;
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user