leetcode.nvim icon indicating copy to clipboard operation
leetcode.nvim copied to clipboard

Cant't sign in leetcode.cn, raise timeout

Open beiyouwuyanzu opened this issue 1 year ago • 1 comments

I use windows10, I sign with cookie after installed raise this error: image

the cookie I use is from this place, it seems no problem:

image

I use cn= leetcom.cn , config as

opts = {
  cn = {
    enabled = true,
  },
},

the detail error info is below:

Error executing vim.schedule lua callback: ...ta/Local/nvim-data/lazy/plenary.nvim/lua/plenary/job.lua:500: 'curl -sSL -D C:\Users\Administrator\AppData\Local\Temp\plenary_curl_905e4572.headers -X POST -H Origin: https://leetcode.cn/ -H Referer: https://leetcode.cn -H Content-Type: application/json -H Accept: application/json -H X-Requested-With: XMLHttpRequest -H User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0 -H X-Csrftoken: fuRpYTaszdT30wek4v8AF4LNNln0tbK5U89VDnGXfdo8tbF25pFFwFJsfES86UmU -H Host: leetcode.cn -H Cookie: {MY_COOKIE} --data-raw {"variables":[],"query":"        query globalData {\n            userStatus {\n                slug: userSlug\n                name: username\n                real_name: realName\n                is_signed_in: isSignedIn\n                is_premium: isPremium\n                is_verified: isVerified\n            }\n        }\n    "} --http2 https://leetcode.cn/graphql/' was unable to complete in 10000 ms
stack traceback:
	[C]: in function 'error'
	...ta/Local/nvim-data/lazy/plenary.nvim/lua/plenary/job.lua:500: in function 'wait'
	...ta/Local/nvim-data/lazy/plenary.nvim/lua/plenary/job.lua:454: in function 'sync'
	...a/Local/nvim-data/lazy/plenary.nvim/lua/plenary/curl.lua:317: in function <...a/Local/nvim-data/lazy/plenary.nvim/lua/plenary/curl.lua:268>
	.../nvim-data/lazy/leetcode.nvim/lua/leetcode/api/utils.lua:92: in function 'query'
	...l/nvim-data/lazy/leetcode.nvim/lua/leetcode/api/auth.lua:22: in function 'user'
	...im-data/lazy/leetcode.nvim/lua/leetcode/cache/cookie.lua:29: in function 'set'
	...im-data/lazy/leetcode.nvim/lua/leetcode/command/init.lua:59: in function 'on_submit'
	...ata/Local/nvim-data/lazy/nui.nvim/lua/nui/input/init.lua:162: in function <...ata/Local/nvim-data/lazy/nui.nvim/lua/nui/input/init.lua:149>

beiyouwuyanzu avatar Oct 01 '24 02:10 beiyouwuyanzu

similar issue, but with leetcode.cn.enabled == false

nikita-starostin avatar Oct 02 '24 09:10 nikita-starostin

same on windows

WayenVan avatar Oct 05 '24 02:10 WayenVan

I have the same problem as well in windows 10. Investigating right now.

furkanCalik7 avatar Oct 11 '24 14:10 furkanCalik7

I resolved the problem by updating the curl to 8.10.1. It seems that the older version of libcurl is not compatible with (curl) --http2 argument.

furkanCalik7 avatar Oct 11 '24 15:10 furkanCalik7

same problem, i use termux in android. my curl version is 8.11.0

wtkl-rc avatar Nov 11 '24 13:11 wtkl-rc

Please use cygwin if you're a windows user. https://github.com/nvim-lua/plenary.nvim/pull/556

kawre avatar Nov 11 '24 14:11 kawre

same problem, i use termux in android. my curl version is 8.11.0

What error are you getting?

kawre avatar Nov 11 '24 14:11 kawre

same problem, i use termux in android. my curl version is 8.11.0

What error are you getting?

I pasted my cookie, and then this error reporting would occur. I used the cn version of leetcode.

IMG_20241111_233052 Screenshot_2024-11-11-23-35-30-636_com termux

wtkl-rc avatar Nov 11 '24 15:11 wtkl-rc

same problem, i use termux in android. my curl version is 8.11.0

What error are you getting?

IMG_20241111_233052 Screenshot_2024-11-11-23-35-30-636_com termux

https://github.com/nvim-lua/plenary.nvim/issues/536 could you check if any of the tips here fix your issue?

kawre avatar Nov 11 '24 16:11 kawre

same problem, i use termux in android. my curl version is 8.11.0

What error are you getting?

IMG_20241111_233052 Screenshot_2024-11-11-23-35-30-636_com termux

nvim-lua/plenary.nvim#536 could you check if any of the tips here fix your issue?

i am so happy that it work,thanks

wtkl-rc avatar Nov 11 '24 16:11 wtkl-rc