Skip to content

Commit

Permalink
fix: make cookie delete function more descritive
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviLhlapak committed Mar 7, 2024
1 parent a079df2 commit f43c874
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eight-pants-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alpakaslab/nextjs-jwt-auth": patch
---

update cookie delete function
7 changes: 6 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ function getApiRoutes<C>(options: ApiOptions<C>) {
},
DELETE: async () => {
try {
cookies().delete(sessionCookieName)
cookies().delete({
name: sessionCookieName,
httpOnly: true,
secure: isSecure,
sameSite: 'lax'
})

return Response.json({ success: true }, { status: 200 })
} catch (e) {
Expand Down

0 comments on commit f43c874

Please sign in to comment.