Token für Reload zusätzlich lokal sichern

This commit is contained in:
2026-06-02 12:14:16 +02:00
parent 822dcdcfb9
commit e9504e21e7
2 changed files with 15 additions and 2 deletions

View File

@@ -8,7 +8,8 @@ export default defineNuxtPlugin(() => {
credentials: "include",
async onRequest({ options }) {
const token = useCookie<string | null>("token", { path: "/" }).value
const auth = useAuthStore()
const token = auth.getStoredToken()
// Falls im Request explizit ein anderer JWT übergeben wird
if (options.context?.jwt) {