diff --git a/composables/auth.ts b/composables/auth.ts index 4c3c3e6..c42ed6b 100644 --- a/composables/auth.ts +++ b/composables/auth.ts @@ -23,9 +23,7 @@ export default function useAuth() { baseURL: api.auth, plugins: [genericOAuthClient(), organizationClient()], fetchOptions: { - baseURL: api.auth, headers, - credentials: "include", }, }); @@ -45,6 +43,9 @@ export default function useAuth() { sessionFetching.value = true; try { + console.log("Fetching: /get-session"); + console.log("url", api.auth + "/get-session"); + console.log("headers", headers); const res = await fetch(api.auth + "/get-session", { headers, credentials: "include", diff --git a/plugins/auth.client.ts b/plugins/auth.client.ts new file mode 100644 index 0000000..0853ffc --- /dev/null +++ b/plugins/auth.client.ts @@ -0,0 +1,5 @@ +import useAuth from "~/composables/auth"; + +export default defineNuxtPlugin(async () => { + await useAuth().fetchSession(); +});