-
Notifications
You must be signed in to change notification settings - Fork 67
Bad csrf token format #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, I have the same issue, I am also using Brave at the moment. I installed Firefox and followed the guide within the README.md and copied it that way. |
This worked for me, thanks. |
Yes, that's where I'm pulling it from. Specifically the Request Header Cookie. Today I had to refresh the cookie. I tried the same technique that worked last time of stripping the The regex is pretty straightforward local csrf = str:match("csrftoken=([^;]+)")
if not csrf or csrf == "" then
return nil, "Bad csrf token format"
end
local ls = str:match("LEETCODE_SESSION=([^;]+)")
if not ls or ls == "" then
return nil, "Bad leetcode session token format"
end and I can confirm this correctly matches my cookie. The real issue is pretty silly. In Brave dev tools, double clicking the 'Cookie' text to highlight it, and then copying it, adds a /CR /LF to the end of the cookie. When you paste this into the NuiInput dialog box and press enter it returns an empty string to the regex. You can tell this is happening when you paste the string and the input box makes this animation and is empty before hitting return. Solution: Ensure you're at https://leetcode.com and signed in (other pages don't always return both |
Using Brave Browser when I look for the cookie in the request header, the "Cookie" field starts with
cf_clearance=*****;csrftoken=***...
. Using this givesBad csrf token format
.I'm able to get it to work by stripping the(see my reply below for the real solution)cf_clearance=***;
from the beginning so it starts withcsrfotken=***;
The text was updated successfully, but these errors were encountered: