question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to log in with a leetcode.com account

See original GitHub issue

🐛 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

login:  Active  Name               Version         Desc
----------------------------------------------------------------------------------------------------
   ✔     solution.discuss   2019.02.03      Plugin to fetch most voted solution in discussions.
   ✔     company            2017.12.18      Plugin to query by company for free user.
   ✔     cache              default         Plugin to provide local cache.
   ✔     retry              default         Plugin to retry last failed request if autologin.enable is on.
   ✘     leetcode.cn        2018.11.25      Plugin to talk with leetcode-cn APIs.
   ✔     leetcode           default         Plugin to talk with leetcode APIs.
[ERROR] You are not login yet?
login: pass: - Signing in leetcode.com
[ERROR] invalid password?

Your Environment

  • os: Windows 10 Family Edition x64 (#18362)
  • extension settings: default
  • nodejs version: 12.4.0
  • vscode version: 1.40.1
  • extension version: 0.15.7

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:49
  • Comments:211 (47 by maintainers)

github_iconTop GitHub Comments

192reactions
wuyifatcommented, Dec 11, 2019

Any step-by-step instructions to solve the problem temporily ? thanks!

Spent an hour and figured it out. Here are the step by step instructions by people newbie like me.

  1. Make sure Node.js 8+ is installed. Instructions can be found on the official page

  2. Install leetcode-cli from OS terminal or the terminal within vscode. Installation guide. Note the “From Github” section links to an older version.

# to remove the old version
npm uninstall -g leetcode-cli
# to install the up-to-date version(2.6.17+)
npm install -g leetcode-tools/leetcode-cli

Type leetcode version in terminal to make sure you installed version 2.6.17+.

  1. Log into leetcode.com in a browser. In Chrome, right click and select “Inspect”. Switch to tab “Network”, “XHR”. Then click any button on leetcode.com(now should be on the left split screen). Now you should be able to see the cookie as @yihong0618 showed in the pic. Copy the entire cookie string starting from “__cfduid” and ending with “_gat=1”

  2. Type leetcode user -c from terminal within vscode. Follow the prompt and type in your username and cookie you copied above.

64reactions
Bigbear325commented, Jan 7, 2020

@jdneo @lostindark

  1. I had tried to use puppeteer but using puppeteer will cause a rotbot check problem.
  2. And the sencond way I also do my best to try but faild, and I happend to find that leetcode is beta their app, maybe we can try to get some luck

@jdneo

  1. I have try to session login that user can copy the cookie from chrome(or others) then paste to the vscode input field, one time login then all the others features are not affected so the user can use vscode-leetcode as usual, can I compelete it and pull request for short-term solution ?

The demo will be like below (user can only copy the cookie and vscode-cli will parser it ): image

image

This cookie but need to add some guide。 image


It works for me, thanks! To be more clear, the cookie is the entire String marked in Red in the pic.

leetcode

Then, In leetcode VS Code, Ctrl + Shift + P, choose, log in with cookie. Your Username, The copied Cookies. Enter!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Report a login problem: "reCAPTCHA failed to load" - LeetCode
Report a login problem: "reCAPTCHA failed to load" · Browser CH or FF · Log off Leetcode if you haven't. · click Sign...
Read more >
I'm unable to login to support platform. Help - Help Center
If you are unable to login to this platform, you can always send us email to `support@leetcode.com` and we will get in touch...
Read more >
Account Login - LeetCode
Sign In. Forgot Password?Sign Up. or you can sign in with. This site is protected by reCAPTCHA and the Google Privacy Policy and...
Read more >
Bug In LeetCode
When you are trying to sign in with the options which you are showing like facebook,gmail etc,instead of ... But it fails in...
Read more >
I can't run code, who can help me. - LeetCode Discuss
Login to Comment. samirpaul1's avatar · samirpaul1 334. May 18, 2021 11:15 AM. Read More. When non-premium users try to submit code very...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found