Add global auth state with composable for reactive login status

This commit is contained in:
Torsten Schulz (local)
2025-10-21 14:12:01 +02:00
parent 86f21537a8
commit 1015d37eb7
175 changed files with 1618 additions and 2157 deletions

View File

@@ -0,0 +1,24 @@
import { hasInjectionContext, inject } from 'vue';
import { a as useNuxtApp } from './server.mjs';
import { u as useHead$1, h as headSymbol } from '../routes/renderer.mjs';
function injectHead(nuxtApp) {
var _a;
const nuxt = nuxtApp || useNuxtApp();
return ((_a = nuxt.ssrContext) == null ? void 0 : _a.head) || nuxt.runWithContext(() => {
if (hasInjectionContext()) {
const head = inject(headSymbol);
if (!head) {
throw new Error("[nuxt] [unhead] Missing Unhead instance.");
}
return head;
}
});
}
function useHead(input, options = {}) {
const head = options.head || injectHead(options.nuxt);
return useHead$1(input, { head, ...options });
}
export { useHead as u };
//# sourceMappingURL=composables-BzCA61rX.mjs.map