vscode-leetcode icon indicating copy to clipboard operation
vscode-leetcode copied to clipboard

login issue

Open zfu1316 opened this issue 8 years ago • 9 comments

I got the issue blow. SyntaxError: Unexpected end of input at Object.parse (native) at Object.cache.get (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\lib\cache.js:17:15) at Function.__dirname.Plugin.deps.deps.Plugin.init.plugins [as init] (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\lib\plugin.js:131:22) at Object.cli.run (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\lib\cli.js:82:14) at Object. (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\bin\leetcode:3:23) at Module._compile (module.js:397:26) at Object.Module._extensions..js (module.js:404:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:429:10) [ERROR] You are not login yet? [0] login: login: pass: login: pass:

zfu1316 avatar Jun 30 '18 21:06 zfu1316

Hi @Allen-Zfu,

Thank you for your feedback. Could this problem be stable reproduced? If yes, could you please tell me the reproduce steps?

jdneo avatar Jul 02 '18 01:07 jdneo

hi,

Actually i have never login successfully, each time i type username and password, i goy this issue.

thanks,

Sent from my iPhone

On Jul 1, 2018, at 9:28 PM, Sheng Chen <[email protected]mailto:[email protected]> wrote:

Hi @Allen-Zfuhttps://github.com/Allen-Zfu,

Thank you for your feedback. Could this problem be stable reproduced? If yes, could you please tell me the reproduce steps?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/jdneo/vscode-leetcode/issues/44#issuecomment-401648592, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgPrt6URR-bjZZQr_WgaXorqDIsxOAynks5uCXcmgaJpZM4U-HSW.

zfu1316 avatar Jul 02 '18 01:07 zfu1316

I see. the plugin is using leetcode-cli as the back-end. If you cannot login through the plugin, could you please try login with leetcode-cli directly? The steps are:

  1. Install leetcode cli: npm install -g leetcode-cli
  2. leetcode user -l

jdneo avatar Jul 02 '18 01:07 jdneo

Hi @Allen-Zfu. Does this issue still occur?

jdneo avatar Jul 12 '18 05:07 jdneo

@jdneo I ran into login issue too.

By inspecting the request this extension made, I found that the endpoint is "leetcode-cn.com" instead of "leetcode.com" while I leaved the "Switch endpoint" unchanged at "Off". By the way, I tried the leetcode-cli you mentioned, and I found the exact same behavior with its default settings.

My solution is to "Switch endpoint" back and forth, and it just worked.

error message and stack:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.cache.get (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/cache.js:17:15)
    at Plugin.save (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/plugin.js:71:22)
    at Function.Plugin.save (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/plugin.js:206:33)
    at Object.cli.run (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/cli.js:83:12)
    at Object.<anonymous> (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/bin/leetcode:3:23)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
[ERROR] You are not login yet? [0]
login: pass: [ERROR] invalid password? [0]

ningw42 avatar Sep 28 '18 16:09 ningw42

@unidentifiedme

Yes, I found several users encountered this same issue. Not sure who to blame now. 😞

jdneo avatar Sep 29 '18 01:09 jdneo

Closing since no more reply from the issue creator for a long time.

jdneo avatar Oct 10 '18 05:10 jdneo

Note: It should be the password of http://leetcode.com, not the password of https://leetcode-cn.com.

leeguooooo avatar Apr 01 '19 06:04 leeguooooo

Note: It should be the password of http://leetcode.com, not the password of https://leetcode-cn.com.

Thanks,I've mixed up them.

MisterChegy avatar Apr 10 '19 12:04 MisterChegy