Partials OK, auto navbar and content

This commit is contained in:
Kevin FEDYNA
2025-01-15 15:43:52 +01:00
parent ed2997d51f
commit 9db588ff02
24 changed files with 510 additions and 321 deletions
+30 -30
View File
@@ -1,30 +1,30 @@
import { Handlers } from "$fresh/server.ts";
import { State } from "$root/routes/_middleware.ts";
import { deleteCookie } from "$std/http/cookie.ts";
const SERVICE = "https://localhost/";
const CAS = "https://ident.univ-amu.fr/cas";
// deno-lint-ignore no-explicit-any
export const handler: Handlers<any, State> = {
GET(_request, context) {
if (context.state.isAuthenticated) {
const headers = new Headers();
deleteCookie(headers, "sessionToken", { path: "/" });
headers.set("Location", `${CAS}/logout?service=${SERVICE}`);
return new Response(null, {
status: 302,
headers,
});
} else {
return new Response(null, {
status: 302,
headers: {
Location: "/",
},
});
}
},
};
import { Handlers } from "$fresh/server.ts";
import { State } from "$root/routes/_middleware.ts";
import { deleteCookie } from "$std/http/cookie.ts";
const SERVICE = "https://localhost/";
const CAS = "https://ident.univ-amu.fr/cas";
// deno-lint-ignore no-explicit-any
export const handler: Handlers<any, State> = {
GET(_request, context) {
if (context.state.isAuthenticated) {
const headers = new Headers();
deleteCookie(headers, "sessionToken", { path: "/" });
headers.set("Location", `${CAS}/logout?service=${SERVICE}`);
return new Response(null, {
status: 302,
headers,
});
} else {
return new Response(null, {
status: 302,
headers: {
Location: "/",
},
});
}
},
};