LeetCode-OpenSource / vscode-leetcode

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

[SOLUTION] Here's how to login with this plugin. #964

Open BETTlM opened 3 months ago

BETTlM commented 3 months ago

Hi, This is how you can sign in using cookies. I'm on Linux and this works perfectly, and I'm not so sure about windows.

Ping me if you face any issues.

https://github.com/user-attachments/assets/6a530529-389d-431b-b564-83efcdff0540

P.S: Visual Studio Code version 1.91.1 Installed from https://aur.archlinux.org/visual-studio-code-bin.git

BETTlM commented 3 months ago

Apologies for poor quality of video.

aditya1819 commented 3 months ago

Thank you @BETTlM for checking it I will try similar way in windows. Just a question, how to grab that login cookie

BETTlM commented 3 months ago

Thank you @BETTlM for checking it I will try similar way in windows. Just a question, how to grab that login cookie

Open leetcode.com Open inspect tab and switch to networks tab. Refresh the page without closing the inspect tab. image Then click on any domain that has 'www.leetcode.com' on it. LIKE: image

Then scroll down to request headers and you will find cookie that starts like ''csfrtoken=xxx....."

Copy the value (by right clicking on top of the text) and that is your cookie. image If this doesn't work, try with any other domain tab.

aditya1819 commented 3 months ago

Cookie sign in worked for me, Thanks @BETTlM

pai4451 commented 3 months ago

@BETTlM Which extension version are you using? And the cookie do we need to add csfrtoken= or simply the value?

BETTlM commented 3 months ago

@BETTlM Which extension version are you using? And the cookie do we need to add csfrtoken= or simply the value?

v1.18.1 is required to login via cookies. You can install the latest version after logging in as shown in the video.

Yes you have to include csfrtoken = xxxx

theashggl commented 3 months ago

Somehow this worked now. I tried the possible ways to sign in before but this tutorial made it work.

onkar75 commented 3 months ago

@BETTlM I tried the above steps but this does not work for me :( ,

https://github.com/user-attachments/assets/f21c7947-bc1d-407c-81ec-f0a01defefb7

BETTlM commented 3 months ago

@BETTlM I tried the above steps but this does not work for me :( ,

https://github.com/user-attachments/assets/f21c7947-bc1d-407c-81ec-f0a01defefb7

You are just pasting the csfr token, not the cookie.

Refer the above messages on how to get the cookie.

theashggl commented 3 months ago

Now we have another update. It seems that the login issue is resolved for good. It works that is good but it is still confusing. I see that the login and logout buttons are both present at the same time. There is no confirmation of login inside the console although there is a popup in the VSCode window which doesn't appear when the login happens by default in the VSCode because of starting of the application.