Updates
This commit is contained in:
parent
109939f6db
commit
97b135c352
@ -116,15 +116,17 @@ export default async function loginUser({
|
||||
|
||||
const { auth_key_cookie_name, csrf_cookie_name } = grabCookieNames();
|
||||
|
||||
const host = req.headers.host;
|
||||
|
||||
setCookie(res, [
|
||||
{
|
||||
name: auth_key_cookie_name,
|
||||
value: encrypted_payload || "",
|
||||
options: {
|
||||
secure: req.headers.origin !== "localhost",
|
||||
secure: host !== "localhost",
|
||||
path: "/",
|
||||
expires: expiration_date,
|
||||
domain: req.headers.origin,
|
||||
domain: host,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -133,7 +135,7 @@ export default async function loginUser({
|
||||
options: {
|
||||
path: "/",
|
||||
expires: expiration_date,
|
||||
domain: req.headers.origin,
|
||||
domain: host,
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
@ -15,19 +15,21 @@ export default async function logoutUser({
|
||||
}: Params): Promise<APIResponseObject> {
|
||||
const { auth_key_cookie_name, csrf_cookie_name } = grabCookieNames();
|
||||
|
||||
const host = req.headers.host;
|
||||
|
||||
deleteCookie(res, [
|
||||
{
|
||||
name: auth_key_cookie_name,
|
||||
options: {
|
||||
path: "/",
|
||||
domain: req.headers.origin,
|
||||
domain: host,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: csrf_cookie_name,
|
||||
options: {
|
||||
path: "/",
|
||||
domain: req.headers.origin,
|
||||
domain: host,
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user