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

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

Open BETTlM opened this issue 1 year ago • 10 comments

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 avatar Jul 14 '24 07:07 BETTlM

Apologies for poor quality of video.

BETTlM avatar Jul 14 '24 07:07 BETTlM

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

aditya1819 avatar Jul 14 '24 07:07 aditya1819

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.

BETTlM avatar Jul 14 '24 07:07 BETTlM

Cookie sign in worked for me, Thanks @BETTlM

aditya1819 avatar Jul 14 '24 15:07 aditya1819

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

pai4451 avatar Jul 16 '24 10:07 pai4451

@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

BETTlM avatar Jul 16 '24 10:07 BETTlM

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

theashggl avatar Jul 17 '24 18:07 theashggl

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

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

onkar75 avatar Jul 23 '24 10:07 onkar75

@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.

BETTlM avatar Jul 23 '24 13:07 BETTlM

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.

theashggl avatar Aug 01 '24 17:08 theashggl