This commit is contained in:
Benjamin Toby 2026-03-12 13:52:34 +00:00
parent 109939f6db
commit 97b135c352
3 changed files with 10 additions and 12 deletions

View File

@ -116,15 +116,17 @@ export default async function loginUser({
const { auth_key_cookie_name, csrf_cookie_name } = grabCookieNames(); const { auth_key_cookie_name, csrf_cookie_name } = grabCookieNames();
const host = req.headers.host;
setCookie(res, [ setCookie(res, [
{ {
name: auth_key_cookie_name, name: auth_key_cookie_name,
value: encrypted_payload || "", value: encrypted_payload || "",
options: { options: {
secure: req.headers.origin !== "localhost", secure: host !== "localhost",
path: "/", path: "/",
expires: expiration_date, expires: expiration_date,
domain: req.headers.origin, domain: host,
}, },
}, },
{ {
@ -133,7 +135,7 @@ export default async function loginUser({
options: { options: {
path: "/", path: "/",
expires: expiration_date, expires: expiration_date,
domain: req.headers.origin, domain: host,
}, },
}, },
]); ]);

View File

@ -15,19 +15,21 @@ export default async function logoutUser({
}: Params): Promise<APIResponseObject> { }: Params): Promise<APIResponseObject> {
const { auth_key_cookie_name, csrf_cookie_name } = grabCookieNames(); const { auth_key_cookie_name, csrf_cookie_name } = grabCookieNames();
const host = req.headers.host;
deleteCookie(res, [ deleteCookie(res, [
{ {
name: auth_key_cookie_name, name: auth_key_cookie_name,
options: { options: {
path: "/", path: "/",
domain: req.headers.origin, domain: host,
}, },
}, },
{ {
name: csrf_cookie_name, name: csrf_cookie_name,
options: { options: {
path: "/", path: "/",
domain: req.headers.origin, domain: host,
}, },
}, },
]); ]);

View File

@ -1,8 +1,2 @@
DSQL_ENCRYPTION_PASSWORD= DSQL_ENCRYPTION_PASSWORD=
DSQL_ENCRYPTION_SALT= DSQL_ENCRYPTION_SALT=
WEB_SOCKET_PORT=3773
PORT=3772
HOST=http://localhost:46079
DOMAIN=localhost