Skip to content

leetcode.cn login error #798

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

Closed
wangp-blog opened this issue May 9, 2022 · 6 comments · Fixed by #800
Closed

leetcode.cn login error #798

wangp-blog opened this issue May 9, 2022 · 6 comments · Fixed by #800

Comments

@wangp-blog
Copy link

wangp-blog commented May 9, 2022

🐛 Bug Report

  • try to login by password:
    pass: - Signing in leetcode-cn.com
    [ERROR] invalid password?
  • try to login by github
    c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:577
    const authenticityToken = body.match(/name="authenticity_token" value="(.*?)"/);
    ^

TypeError: Cannot read properties of undefined (reading 'match')
at Request._callback (c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:577:36)
at self.callback (c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\request\request.js:185:22)
at Request.emit (node:events:526:28)
at Request.onRequestError (c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\request\request.js:881:8)
at ClientRequest.emit (node:events:526:28)
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:526:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

  • try to login by cookie
    success!
    invalid cookie

To Reproduce

  • leetcode.cn

Expected behavior

login !

Extension Output

Guidance: Press Ctrl+Shift+U, and toggle the channel to LeetCode.
pass: - Signing in leetcode-cn.com
[ERROR] invalid password?
login: (node:28504) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
pass: c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:577
const authenticityToken = body.match(/name="authenticity_token" value="(.*?)"/);
^

TypeError: Cannot read properties of undefined (reading 'match')
at Request._callback (c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:577:36)
at self.callback (c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\request\request.js:185:22)
at Request.emit (node:events:526:28)
at Request.onRequestError (c:\Users\HP.vscode\extensions\leetcode.vscode-leetcode-0.18.0\node_modules\request\request.js:881:8)
at ClientRequest.emit (node:events:526:28)
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:526:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

Your Environment

  • os: windows 10
  • extension settings: default
  • nodejs version:16.14.2
  • vscode version:1.67.0
  • extension version:0.18.0
@labuladong
Copy link

是域名的问题,我基于官方插件修改的版本修复了这个问题,详情看这里:labuladong 的 vscode 刷题插件

@wangp-blog
Copy link
Author

wangp-blog commented May 9, 2022

是域名的问题,我基于官方插件修改的版本修复了这个问题,详情看这里:labuladong 的 vscode 刷题插件

感谢分享,经过测试,现有的问题是leetcode.cn在submit和test时有误,提示
[ERROR] http error [code=301]
问题和issue #799 一致

@labuladong
Copy link

感谢分享,经过测试,现有的问题是leetcode.cn在submit和test时有误,提示 [ERROR] http error [code=301]

试了下,我修改发布的版本中不会出现这个 bug,你试试看?

@Spencerhyuk
Copy link

同样的问题,如果不更换插件,如何在原有基础上解决

@Chever-John
Copy link

@Spencerhyuk, you must fork one and publish it to use it.

@Chever-John
Copy link

Chever-John commented May 9, 2022

@Spencerhyuk Please check this link.
It will solve your issue.

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

Successfully merging a pull request may close this issue.

4 participants