Fix bug causing broken login state w/ malformed cookie #229
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
arduinohatesme/leetcode.nvim!229
Loading…
Reference in a new issue
No description provided.
Delete branch "jmann345/fix/recover-cookie-from-devtools-paste"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: If a cookie was pasted with surrounding text, it would be accepted as valid if it contained
csrftoken=andLEETCODE_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 inFix: Strip token to just the line containing
csrftokenandLEETCODE_SESSIONand aCookiebuilt 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.