-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add third party github login for future updates in vscode-leetcode #34
Conversation
…d somehow solve the recaptcha problem
Will take a look at the PR before the end of this week. Thank you @yihong0618 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well Done!
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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leetcode -> 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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linkedin -> LinkedIn
lib/plugins/leetcode.js
Outdated
} | ||
const authenticityToken = body.match(/input name="loginCsrfParam" value="(.*)" /); | ||
if (authenticityToken === null) { | ||
return cb('Get Linkedin token failed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LeetCode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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