Skip to content

Commit

Permalink
Fix case where secureCookie is passed as false, and we need it to sta…
Browse files Browse the repository at this point in the history
…y false (#704)

in evaluation.  Use the nullish coalescing operator here to avoid calling into
getServerOrigin(), which does not apply to our use case.

Co-authored-by: Marsel Shayhin <18054980+phoenix-ru@users.noreply.github.com>
  • Loading branch information
kwesterfeld2 and phoenix-ru authored Mar 14, 2024
1 parent 454f5a0 commit 5d713aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/server/services/authjs/nuxtAuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export const getToken = <R extends boolean = false>({ event, secureCookie, secre
headers: getHeaders(event) as IncomingHttpHeaders
},
// see https://github.com/nextauthjs/next-auth/blob/8387c78e3fef13350d8a8c6102caeeb05c70a650/packages/next-auth/src/jwt/index.ts#L73
secureCookie: secureCookie || getServerOrigin(event).startsWith('https://'),
secureCookie: secureCookie ?? getServerOrigin(event).startsWith('https://'),
secret: secret || usedSecret,
...rest
})
Expand Down

0 comments on commit 5d713aa

Please sign in to comment.