add third party github login for future updates in vscode-leetcode#34
add third party github login for future updates in vscode-leetcode#34jdneo merged 5 commits intoleetcode-tools:masterfrom yihong0618:master
Conversation
…d somehow solve the recaptcha problem
|
Will take a look at the PR before the end of this week. Thank you @yihong0618 |
jdneo
left a comment
There was a problem hiding this comment.
Please correct me if I'm wrong.
If the user enables two-factor auth in GitHub, this method won't able to login, I'm I right?
|
And I tonight I will add Linkedin login maybe, Facebook has a little problem, Google will not work |
|
Hmm, actually I failed to login using my GitHub account. Does your GitHub account enable the two-factor auth? |
|
|
Sure I'll try with LinkedIn later tonight... |
And I think you can disconnect and connect another Github account for test. |
|
Tried another GitHub account without 2-factor auth, and login successfully. So I think we can first hint to user that 2-factor auth is not supported yet. And spend some time to see if it is possible to enable it. |
lib/plugins/leetcode.js
Outdated
| _request.get({url: leetcodeUrl}, function(e, resp, body) { | ||
| const redirectUri = resp.request.uri.href; | ||
| if (redirectUri !== 'https://leetcode.com/') { | ||
| return cb('GitHub login failed or GitHub did not link to leetcode'); |
lib/plugins/leetcode.js
Outdated
| }); | ||
| _request('https://www.linkedin.com', function(e, resp, body) { | ||
| if ( resp.statusCode !== 200) { | ||
| return cb('Get linkedin session failed'); |
lib/plugins/leetcode.js
Outdated
| } | ||
| const authenticityToken = body.match(/input name="loginCsrfParam" value="(.*)" /); | ||
| if (authenticityToken === null) { | ||
| return cb('Get Linkedin token failed'); |
lib/plugins/leetcode.js
Outdated
| _request.get({url: leetcodeUrl}, function(e, resp, body) { | ||
| const redirectUri = resp.request.uri.href; | ||
| if (redirectUri !== 'https://leetcode.com/') { | ||
| return cb('Linkedin login failed or Linkedin did not link to leetcode'); |
There was a problem hiding this comment.
Sorry for that, I will correct them~
Thank you very much for your help ~
OK, seems a little hard but I will try. |
|
Yes, no need to support facebook at this time. GitHub and LinkedIn are good enough! |
|
Thank you @yihong0618. Would you like me to publish a new release for this change? |
|
Yes. |
|
@yihong0618 Sure! Will the PR you mentioned be raised in this repo? |


Add third party github login for future updates in vscode-leetcode and somehow solve the recaptcha problem.
Users only need to connect github(or already connected) can use leetcode user -g can login leetcode in leetcode-cli and future for vscode-leetcode(other third parties also can add except google... I will add it if necessary)
how to connect github