Proper authentication (needs more user feedback)

This commit is contained in:
2026-07-18 00:31:47 -04:00
parent 6aab99ab8f
commit c7530dcbab

View File

@@ -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);
};