LeetCode-OpenSource / vscode-leetcode

Solve LeetCode problems in VS Code
https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-leetcode
MIT License
8.2k stars 648 forks source link

Cannot login when using GitHub with MFA #925

Open k86td opened 7 months ago

k86td commented 7 months ago

πŸ› Bug Report

The login fails saying I need to enter my correct credentials:

pass: [ERROR] Login failed. Please make sure the credential is correct.

My credentials are alright, I'm receiving sudo request on Git Mobile.

To Reproduce

Enable 2 factor methods on GitHub (currently I'm using GitHub mobile), then try to login inside VSCode extension.

Expected behavior

The extension should detect usage of MFA on GitHub and give a number to enter inside Git mobile to allow sudo request.

Extension Output

Extension output:

 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.
(node:22676) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
[ERROR] You are not login yet?
(node:22104) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
login: (node:21912) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
pass: [ERROR] Login failed. Please make sure the credential is correct.
login: (node:7028) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
pass: [ERROR] Login failed. Please make sure the credential is correct.
login: (node:15356) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
pass: [ERROR] Login failed. Please make sure the credential is correct.
login: (node:20040) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
pass: [ERROR] Login failed. Please make sure the credential is correct.

Your Environment

TangyrenMidKing commented 7 months ago

facing the same issue. Cannot log in even change the auth type to leetcode login. login: (node:18524) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Usenode --trace-warnings ...to show where the warning was created) pass: - Signing in leetcode.com [ERROR] session expired, please login again [code=-1]

snowproud commented 7 months ago

the same issue. I have tried all login method(leetcode account, third-party account, cookie), and all failed.

Matthewow commented 7 months ago

Same here

fLexsooP commented 7 months ago

same issue here

Lakhwinderr commented 7 months ago

same isssue: TypeError: Cannot read properties of undefined (reading 'toString') at c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\log.js:55:31 at Array.map () at Object.log. [as info] (c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\log.js:55:20) at c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\commands\user.js:121:13 at c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:523:14 at Request._callback (c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:422:19) at Request.self.callback (c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\request\request.js:185:22) at Request.emit (node:events:390:28) at Request. (c:\Users\LAKHWINDERSINGH.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\request\request.js:1161:10) at Request.emit (node:events:390:28) login: (node:21528) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created) pass: - Signing in leetcode.com

ChatGPT says: It appears that you're encountering an error related to session expiration while using the LeetCode extension for Visual Studio Code. This error indicates that your session with LeetCode has expired, and you need to log in again.

To resolve this issue, you should follow these steps:

  1. Log in Again: Follow the instructions provided by the extension to log in again to your LeetCode account. This typically involves navigating to the login page and entering your credentials.

  2. Check Session Duration: Take note of the session duration for LeetCode. If the session duration is short, you may want to check if there's an option to extend the session duration or keep the session alive while you're actively using the extension.

  3. Verify Account: Ensure that your LeetCode account is in good standing and that there are no issues with your account that could be causing the session expiration.

  4. Update Extension: Check if there are any updates available for the LeetCode extension in Visual Studio Code. Updating to the latest version of the extension may address any bugs or issues related to session management.

  5. Contact Support: If you continue to experience issues with session expirations, consider reaching out to the support team for the LeetCode extension or LeetCode platform. They may be able to provide further assistance or insights into the problem.

By following these steps, you should be able to log in again to your LeetCode account and continue using the extension without encountering session expiration errors.

wytsai7660 commented 7 months ago

Any update? I don't think it would be a good idea to turn off 2FA just for that 😐

leni8ec commented 7 months ago

same here(

k86td commented 6 months ago

I'll take a look at it. First, I've never touched extension dev. And seeing the activity of this repo, I'm not sure a pull request can even get through.

Might be better to just use the fork on the marketplace, but I don't know how it's done.