Skip to content

Fix bug causing broken login state w/ malformed cookie - #229

Open
jmann345 wants to merge 1 commit into
kawre:masterfrom
jmann345:fix/recover-cookie-from-devtools-paste
Open

Fix bug causing broken login state w/ malformed cookie#229
jmann345 wants to merge 1 commit into
kawre:masterfrom
jmann345:fix/recover-cookie-from-devtools-paste

Conversation

@jmann345

@jmann345 jmann345 commented Jul 4, 2026

Copy link
Copy Markdown

Bug: If a cookie was pasted with surrounding text, it would be accepted as valid if it contained csrftoken= and LEETCODE_SESSION= but break when pasted in, causing leetcode.nvim to be in a broken state where I had to manually edit the cookie file in order to log in

Fix: Strip token to just the line containing csrftoken and LEETCODE_SESSION and a Cookie built from just that line.

Note: This fix may not apply for cookies malformed in other ways, but it fixed the case where I accidentally pasted surrounding text from the cookie in my web browser. A more robust solution for gracefully handling all types of malformed cookie text and recovering when possible exists.

Validation: Logged out, pasted in the same malformed cookie text i pasted in earlier, and had a successful login. Also verified that correctly-formed cookie text still works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant