chore: replace gin with standard lib net/http

This commit is contained in:
Christoph Haas
2025-03-09 21:16:42 +01:00
parent 7473132932
commit 0206952182
58 changed files with 5302 additions and 1390 deletions

View File

@@ -4,6 +4,7 @@ import LoginView from '../views/LoginView.vue'
import InterfaceView from '../views/InterfaceView.vue'
import {authStore} from '@/stores/auth'
import {securityStore} from '@/stores/security'
import {notify} from "@kyvg/vue3-notification";
const router = createRouter({
@@ -63,6 +64,7 @@ const router = createRouter({
router.beforeEach(async (to) => {
const auth = authStore()
const sec = securityStore()
// check if the request was a successful oauth login
if ('wgLoginState' in to.query && !auth.IsAuthenticated) {
@@ -112,6 +114,10 @@ router.beforeEach(async (to) => {
auth.SetReturnUrl(to.fullPath) // store original destination before starting the auth process
return '/login'
}
if (publicPages.includes(to.path)) {
await sec.LoadSecurityProperties() // make sure we have a valid csrf token
}
})
export default router