Skip to content

Commit

Permalink
fix: don't specific domain when set cookie (#377)
Browse files Browse the repository at this point in the history
Because

- cookie domain setting is troublesome

This commit

- don't specific domain when set cookie
  • Loading branch information
EiffelFly committed Mar 22, 2023
1 parent 9bf8de5 commit 109a5f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/api/set-user-cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
value: JSON.stringify({
cookie_token: body.token,
}),
domain: req.headers.origin ? new URL(req.headers.origin).hostname : null,
domain: null,
maxAge: 60 * 60 * 24 * 30,
httpOnly: process.env.NODE_ENV === "production" ? true : false,
};
Expand Down

0 comments on commit 109a5f9

Please sign in to comment.