diff --git a/app/hooks/auth.tsx b/app/hooks/auth.tsx index cf629c9..bd2e3e9 100644 --- a/app/hooks/auth.tsx +++ b/app/hooks/auth.tsx @@ -28,7 +28,7 @@ export function AuthProvider({children}: PropsWithChildren) { const load = async () => { if (searchParams.get("openid.ns") !== null) { - let response = await fetch("http://localhost:8080/login?" + searchParams.toString()).then(r => r.text()); + let response = await fetch("http://localhost:8080/login?" + searchParams.toString(), {credentials: "include"}).then(r => r.text()); setSeachParams({}, {replace: true}); if (response === "nok") { // TODO: signal error to user @@ -50,6 +50,7 @@ export function AuthProvider({children}: PropsWithChildren) { }; const logout = async () => { + await fetch("http://localhost:8080/logout", {credentials: "include"}) setUser(null); };