Skip to content
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

leetcode login problem #92

Open
jason--liu opened this issue Aug 26, 2021 · 3 comments
Open

leetcode login problem #92

jason--liu opened this issue Aug 26, 2021 · 3 comments

Comments

@jason--liu
Copy link

jason--liu commented Aug 26, 2021

Hi, first of all thanks for your great package.
Recently leetcode seems has changed its login mechanism.
When try to execute leetcode-try or leetcode-submit, the error message below

HTTP/1.1 403 Forbidden
Date: Thu, 26 Aug 2021 11:28:20 GMT
Content-Type: application/json
Content-Length: 38
Connection: keep-alive
X-Frame-Options: DENY
Vary: Cookie
Set-Cookie: LEETCODE_SESSION=""; Domain=.leetcode.com; expires=Thu, 01 Jan 1970 00:00:00 GMT; Max-Age=0; Path=/; SameSite=Lax
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=PyJPhKpOOoh8GoZgW2D1re9%2FLqeA8vR9249m0pWMxXjRX3n3tLhjymhWqeaTlTfuTrVCg4K9j1WGAkf1xwrLwfG6ho1Se7xIwe2m3elbSaFqzavBeXsON3qdw8R6og%3D%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
X-Content-Type-Options: nosniff
Server: cloudflare
CF-RAY: 684cb74fcda730d4-SEA

{"error": "User is not authenticated"}

Is there any way to fix or workaround this issue? Thank you.

@kaiwk
Copy link
Owner

kaiwk commented Oct 5, 2021

I can see LEETCODE_SESSION="", maybe that's the problem here?

You need to make sure you've logged in leetcode.com using Chrome or Firefox recently, so that Emacs can retrieve the cookies from leetcode.com.

@KngZhi
Copy link

KngZhi commented Dec 25, 2021

I was encountered the same problem, here is what I did:

  1. at the terminal using command $ my_cookies to check a) whether the package installed and b) the cookies can be normally accessed, the ideal result would print your LEETCODE_SESSION and csrftoken
  2. if the terminal print get cookie failed, then check a) whether login in the Leetcode or b) did you turn off the cookie option of your chrome, here is link for how to turn on the cookie setting for Chrome.

你的 Session 没东西,说明 emacs 没拿到 cookie 里的东西。你要检查一下浏览器的设置以及你是不是登录了 leetcode.

我之前为了隐私安全禁止了跨三方 cookie 的使用和保存所以在终端执行 my_cookies 总是拿不到值。

@lamduong33
Copy link

my_cookies was not installed by the package for me. Simply installing my_cookies via pip solved this problem for me.

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

No branches or pull requests

4 participants