Work on login

This commit is contained in:
2026-09-11 22:23:00 +02:00
parent abf00ac401
commit fb09048e45
14 changed files with 168 additions and 26 deletions
+8
View File
@@ -6,6 +6,7 @@ import { i18n, setLocale, initialLocale } from './i18n.js'
import './css/all.css'
import App from './app.vue'
import { isLogedIn } from './global.js'
await setLocale(initialLocale())
@@ -18,5 +19,12 @@ if (import.meta.hot) {
handleHotUpdate(router)
}
router.beforeEach(async (to, from) => {
if (!isLogedIn.value && to.name != '/login' ) {
// redirect the user to the login page
return { name: '/login' }
}
})
createApp(App).use(router).use(i18n).mount('#app')