Closed jebibot closed 5 months ago
I'd love to test this on my own project but was having trouble patching the @supabase/ssr package with this. Is there a way it can be done?
If this is considered, it likely needs to use jose
for cross-platform support. This has been an issue in the past.
Will it work with unicode symbols in JSON?
It can be user name for example
@dalkommatt i typically do pnpm build
in the root of the auth-helpers repo and then npx install-from /path/to/auth-helpers/packages/ssr
in the project that i want to test the changes in
@jebibot we've decided to go with #726 to fix the cookie chunking issues so i'll be closing this PR.
What kind of change does this PR introduce?
Feature
What is the current behavior?
The session cookie value is a plain JSON string, which gets URL-encoded by most server implementations. This causes a mismatch in the length calculation in the chunker; sometimes, cookie values exceed the max length.
What is the new behavior?
This PR base64-encodes the cookie value before passing to the chunker.
The rationale for using base64:
{
,}
,"
,[
,]
to 3 characters tripling in length, whereas base64 encoding increasesx4/3
in bytes, so the overall length would be similarAdditional context
Closes #680. Fixes #643 and fixes #696.