payload icon indicating copy to clipboard operation
payload copied to clipboard

Error is thrown when a cookie cannot be decoded even if it is one not used by payload

Open powerpaul17 opened this issue 11 months ago • 2 comments

Describe the Bug

The code in https://github.com/payloadcms/payload/blob/d55b6a3db95edd78c230a82553484df437435151/packages/payload/src/utilities/parseCookies.ts#L14 throws an error if a cookie cannot be decoded. I have Authelia set up and therefore an additional cookie is sent with each request. This cookie cannot be decoded by the function in the code. Therefore an error is thrown and the administration interface is unusable. Probably the API too.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/blob/d55b6a3db95edd78c230a82553484df437435151/packages/payload/src/utilities/parseCookies.ts#L14

Reproduction Steps

There is no specific setup which triggers this issue, so I cannot provide a "reproduction".

  1. Try to login into payload administration section.
  2. Does not login, server shows error thrown in https://github.com/payloadcms/payload/blob/d55b6a3db95edd78c230a82553484df437435151/packages/payload/src/utilities/parseCookies.ts#L14

Which area(s) are affected? (Select all that apply)

Not sure

Environment Info

Payload: 3.9.0,
Node.js: 22.6.0
Next.js: 15.0.4

powerpaul17 avatar Jan 15 '25 11:01 powerpaul17

Is there anything I can do to get this fixed? It is really annoying not being able to login. 🙁

powerpaul17 avatar Mar 10 '25 08:03 powerpaul17

I created a pull request https://github.com/payloadcms/payload/pull/12515 to fix this

alexrah avatar May 22 '25 23:05 alexrah

Issue resolved by this PR.

jessrynkar avatar Jun 16 '25 11:06 jessrynkar

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Jun 24 '25 05:06 github-actions[bot]