Skip to content

Commit

Permalink
hotfix: update fetch logic
Browse files Browse the repository at this point in the history
  • Loading branch information
josselinonduty committed Feb 11, 2025
1 parent df18cd4 commit bdba31f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions composables/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export default function useAuth() {
baseURL: api.auth,
plugins: [genericOAuthClient(), organizationClient()],
fetchOptions: {
baseURL: api.auth,
headers,
credentials: "include",
},
});

Expand All @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions plugins/auth.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import useAuth from "~/composables/auth";

export default defineNuxtPlugin(async () => {
await useAuth().fetchSession();
});

0 comments on commit bdba31f

Please sign in to comment.