added token storage in a store, and improved layout on mobile

This commit is contained in:
2025-12-15 16:24:30 +01:00
parent d6a26c0d09
commit 0714088d4b
17 changed files with 170 additions and 154 deletions

View File

@@ -1,5 +1,5 @@
import { createRouter, createWebHistory } from 'vue-router'
import { useAuthStore } from '../stores/auth'
import { initAuth } from '../stores/auth.ts'
import LoginPage from '../pages/LoginPage.vue'
import RoomsPage from '../pages/RoomsPage.vue'
@@ -14,8 +14,8 @@ const router = createRouter({
],
})
router.beforeEach((to) => {
const auth = useAuthStore()
router.beforeEach(async (to) => {
const auth = await initAuth()
if (!auth.isAuthenticated && to.path !== '/login') {
return '/login'
}