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 { 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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user