-
Notifications
You must be signed in to change notification settings - Fork 650
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
Failed to log in with a leetcode.com account #478
Comments
+1 |
How to make it works? |
+1 |
I have the same problem that I switched to leetcode-cn endpoint yesterday but cannot login my leetcode account anymore. I have tried to use the mobile's hotpot and vpn global mode, still failed. Is there any solution to solve this problem? P.S. reinstalling cannot solve this. Extension Outputlogin: login: Active Name Version Desc✘ solution.discuss 2019.02.03 Plugin to fetch most voted solution in discussions. TypeError: Cannot read property 'toString' of undefined |
same issue |
+1 |
+1 |
1 similar comment
+1 |
+1 |
same issue |
same bug here, can not login while same username and pw are working fine on leetcode website |
+1, the same issue. |
+1, same issue |
same |
Hi @ALL, Sorry I'm busying with my work these days. Hope we could have volunteers who are interested to provide fixed in the upstream repo: https://github.com/leetcode-tools/leetcode-cli |
Hi @jdneo I try to fix the problems in leetcode-cliBut leetcode.com use recaptcha which is hard to generate the token when use post to login.
|
@yihong0618 Thank you for the great effort! I guess if leetcode has applied the recaptcha token. leetcode-cn will finally migrate to it in some time. Hope we can find a way to resolve it. Thank you again! |
+1 |
@jdneo 登录页https://leetcode.com/accounts/login/ 首次登陆会生成一个 id名为recaptcha-token,这个就是@yihong0618 说的谷歌的https://www.google.com/recaptcha/intro/v3.html 每次用户登陆的时候貌似都要检查一下这个hidden的value. 有没有办法存储在plugin临时文件里? 因为没有开发过plugin不清楚是否可行。 <input id="recaptcha-token" type="hidden" value="03AOLTBLRLMf9Mib_S4ixPeHd9qQQjEpPRvs1NVhsWvJogjBEZriWO-0L58e5Umzd3b5l98t2vW2s532-jSRqQRr23lZuJSx_PyClRRIjK4Wjv6pUh5pafJRvLLYTZqMbJ3JtiwlohtKDiggB6yYqsFZNY_t8IDnHlWKivV4SvW6nCSGjg4aFGTfySip7QlUQv5N54E_V4BmmffNoLrEr2tMgiODzSCy7TbA9rUHO4RbI30HQsF4sZt9pGk3u2RbUaeNxDWqyxeTuvPOrz8LgNoOeST142GkHHoCiVwbFcm1lPDBLizIbKpf77YwNdg0FhtqJq1SJcq35PniBEdEMH8EMB_kH2KJcTK51_X_cqUH2ddOzMxwoMPn95lQn5m7w3UjKPUxI-zAKDRtEook66jJK3TNwT7QdTK3edZjNs1znypTgA0Et3kO8"> const opts = {
url: config.sys.urls.login,
headers: {
Origin: config.sys.urls.base,
Referer: config.sys.urls.login,
Cookie: 'csrftoken=' + user.loginCSRF + ';'
},
form: {
csrfmiddlewaretoken: user.loginCSRF,
login: user.login,
password: user.pass
//probably here, we might need one more recaptcha-token
}
}; |
@CoolersCoder |
This problem is a little bit tricky. Recaptcha is hard to deal without a browser. I can think of 2 ways to fix this:
None of these are simple, maybe we should talk to leetcode and see if there are any support way of login for plugins? |
@lostindark Thank you, I'll try to reach leetcode recently. But I'm not sure who should be talked to. If anyone knows, please let me know. |
@yihong0618 Have you tried to turn headless off?
The other way to try is to set a normal chrome user agent and see if that works. |
@lostindark |
+1 |
I was able to use the Cookie way to log in. I don't know why it's not working last time. But this morning I tried it with my email and the cookie with the format of: csrftoken="xyz";LEETCODE_SESSION="xyz"; Hope this will help. |
I can confirm that it is possible to log in by entering your email and the cookie in the format of: |
it's still not working , i tried it with my email and the cookie with the format of: user.paid = _user.isCurrentUserPremium;
TypeError: Cannot read properties of null (reading 'isCurrentUserPremium') |
+1 |
Can not login with cookies.
|
Same here. It was working till afternoon, but suddenly stopped working from evening. Please let me know if you were able to find a workaround. |
I'm having the same difficulties, but it's working again as of right now |
It works, thanks! |
你好,邮件收到了,会尽快回复。
|
Why don't just watch this https://www.youtube.com/watch?v=zNOJWXZ3i_Q |
你好,邮件收到了,会尽快回复。
|
helpful |
same |
你好,邮件收到了,会尽快回复。
|
same question, it was working fine in yesterday, but when I try to use this plugin today, it just cannot login. |
same question. It worked yesterday, but not today |
After adding some logs, it seems that the login requests are blocked by Cloudflare's JS Challenge. Have tried changing IPs and adding headers like User-Agent, but still not working. Perhaps it's related to some Cloudflare specified cookies to check if the request is from a browser or a script, not sure what to do next. |
Anyone successfully login recently? I tried the approach but still the same error:
|
I tried this, and it worked. |
was having this problem but this solution worked
just copy and paste csrftoken="xyz"; LEETCODE_SESSION="xyz"; somewhere else then go grab the two cookie values and replace xyz with them. after that copy the entire thing and use it as cookie login |
Here to say that this method is still working in July 2024, Thanks for the solution...! |
你好,邮件收到了,会尽快回复。
|
I JUST managed to get it working (1st September 2024 right now) and did NOT use the cookie method. My cookies were correct, as I was able to send a curl request and it returned my username (using the following command):
Note, now I've got a new problem, which is code completion does not work at all. |
你好,邮件收到了,会尽快回复。
|
🐛 Bug Report
I can't log into my leetcode.com account via vscode plugin, but I can log in with the same email & password in the browser.
In contrast, my leetcode-cn.com account seems to work fine with this vscode plugin.
To Reproduce
None
Expected behavior
Log into my leetcode.com account.
Extension Output
Your Environment
The text was updated successfully, but these errors were encountered: