timetracker update

This commit is contained in:
Daniel Goc
2026-03-11 09:33:36 +01:00
parent bbf8a2c133
commit 9ef4bb219b
121 changed files with 4328 additions and 2231 deletions

View File

@@ -1,9 +1,9 @@
import { createRouter, createWebHistory } from 'vue-router'
import Default from '@/layouts/default.vue'
import Empty from '@/layouts/empty.vue'
import { currentLang, initLangs, langs } from './langs'
import { currentLang, langs } from './langs'
import { getSettings } from './settings'
import { useAuthStore } from '@/stores/auth'
import Default from '@/layouts/default.vue'
// Helper: read the non-HTTPOnly is_authenticated cookie set by the backend.
// The backend sets it to "1" on login and removes it on logout.
@@ -13,7 +13,6 @@ function isAuthenticated(): boolean {
}
await initLangs()
await getSettings()
@@ -27,18 +26,17 @@ const router = createRouter({
{
path: '/:locale',
children: [
// {
// path: '',
// component: Default,
// children: [
// ],
// },
{
path: '',
component: Default,
children: [
{ path: '', component: () => import('../views/RepoChartView.vue'), name: 'home' },
],
},
{
path: '',
component: Empty,
children: [
{ path: '', component: () => import('../views/HomeView.vue'), name: 'home' },
{ path: 'chart', component: () => import('../views/RepoChartView.vue'), name: 'chart' },
{ path: 'login', component: () => import('@/views/LoginView.vue'), name: 'login', meta: { guest: true } },
{ path: 'register', component: () => import('@/views/RegisterView.vue'), name: 'register', meta: { guest: true } },
{ path: 'password-recovery', component: () => import('@/views/PasswordRecoveryView.vue'), name: 'password-recovery', meta: { guest: true } },
@@ -58,6 +56,9 @@ router.beforeEach((to, from, next) => {
// Check if the locale is valid
if (locale && langs.length > 0) {
const authStore = useAuthStore()
console.log(authStore.isAuthenticated,to, from)
// if()
const validLocale = langs.find((l) => l.lang_code === locale)
if (validLocale) {