feat: frontend für login, konto und benutzerverwaltung
- Login-Seite, Auth-Store und Router-Guard mit Weiterleitung nach dem Login - API-Client sendet X-CSRF-Token und reagiert auf 401 - Konto: Passwort ändern, angemeldete Geräte anzeigen und widerrufen - Benutzerverwaltung für Admins: anlegen, Rolle, aktiv, Passwort-Reset, löschen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9585b395c
commit
4c2500797b
14 files changed
+873
-63
No files matched your search
@@ -3,12 +3,22 @@ import './assets/main.css'
|
||||
import { createPinia } from 'pinia'
|
||||
import { createApp } from 'vue'
|
||||
|
||||
import { setUnauthorizedHandler } from './api/client'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import { useAuthStore } from './stores/auth'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
|
||||
// Session expired or revoked elsewhere: drop local state and go to the login page
|
||||
setUnauthorizedHandler(() => {
|
||||
useAuthStore().clear()
|
||||
if (router.currentRoute.value.name !== 'login') {
|
||||
void router.push({ name: 'login', query: { redirect: router.currentRoute.value.fullPath } })
|
||||
}
|
||||
})
|
||||
|
||||
app.mount('#app')
|
||||
Reference in new issue
Block a user