Skip to content

Commit

Permalink
chore: Add httpOnly in cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
builtbysuraj committed Mar 2, 2024
1 parent 02ecc93 commit 9ffc18d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/src/controller/user/login.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const loginUser = async (req, res) => {
})

res.cookie('token', token, {
httpOnly: true,
secure: true,
sameSite: 'none',
maxAge: 24 * 60 * 60 * 1000,
Expand Down
1 change: 1 addition & 0 deletions server/src/controller/user/register.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const registerUser = async (req, res) => {
})

res.cookie('token', token, {
httpOnly: true,
secure: true,
sameSite: 'none',
maxAge: 24 * 60 * 60 * 1000,
Expand Down

0 comments on commit 9ffc18d

Please sign in to comment.