From 8b3e3da71c77927a6e508e9cac2bb7e9ff04f8b0 Mon Sep 17 00:00:00 2001 From: Expand-sys Date: Sat, 24 Dec 2022 10:50:45 +1100 Subject: [PATCH] fixed logout --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index eff5d1b..bd796cf 100644 --- a/index.js +++ b/index.js @@ -26,12 +26,14 @@ fastify.register(require("fastify-secure-session"), { cookieName: "session", // adapt this to point to the directory where secret-key is located key: fs.readFileSync(path.join(__dirname, "secret-key")), - cookie: { + Cookie: { path: "/", // options for setCookie, see https://github.com/fastify/fastify-cookie - secure: `${process.env.SECURE}`, + signed: true, + secure: "auto", httpOnly: true, overwrite: true, + sameSite: "none", }, }); fastify.register(fastifyFlash); @@ -355,7 +357,7 @@ fastify.register(require("./routes/admin"), { prefix: "/admin" }); fastify.register(require("./routes/settings"), { prefix: "/settings" }); fastify.get("/logout", async function (req, res) { - let checkalive = await got(`${api}../properties`, { + let checkalive = await got(`${api}/api/properties`, { headers: { Accept: "application/json", },