Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add third party github login for future updates in vscode-leetcode#34

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jdneo merged 5 commits intoleetcode-tools:masterfromyihong0618:master
Dec 24, 2019
Merged

Conversation

yihong0618
Copy link

@yihong0618yihong0618 commentedDec 16, 2019
edited
Loading

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 useleetcode 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

  1. find profile page (https://leetcode.com/profile/account/)
  2. link your github id like below
  3. Or user use github to login leetcode at the first will also work
  4. use github account can login to leetcode
    image

@jdneo
Copy link

Will take a look at the PR before the end of this week. Thank you@yihong0618

Copy link

@jdneojdneo left a 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?

@yihong0618
Copy link
Author

yihong0618 commentedDec 17, 2019
edited
Loading

And I tonight I will add Linkedin login maybe, Facebook has a little problem, Google will not work
I think in vscode-leetcode just one third party login will be nice, user can just select their way to login.
And just to change singin method in vscode-leetcode will be easy.

@jdneo
Copy link

Hmm, actually I failed to login using my GitHub account. Does your GitHub account enable the two-factor auth?

@yihong0618
Copy link
Author

yihong0618 commentedDec 18, 2019
edited
Loading

Hmm, actually I failed to login using my GitHub account. Does your GitHub account enable the two-factor auth?
Sorry, two-factor auth is not support for now
Mine is fine. I will test another account.

  1. No my account not enable two-factor auth
  2. Did you use your Github accout not your leetcode accout
  3. Did you link your Github accout to leetcode in leetcode.
  4. Can you try to linkedin accout either, because I only have one, sorry for that.

@jdneo
Copy link

Sure I'll try with LinkedIn later tonight...

@yihong0618
Copy link
Author

image
I sign up a new accout that use github accout at the first time.
If its a new accout you must verity your email in leetcode and email accout, maybe you miss that?

@jdneo
Copy link

It should be verified before. The account already connected.

image

Could you try enable the 2-factor auth for your GitHub account? You can find it in the Settings > Security

@yihong0618
Copy link
Author

It should be verified before. The account already connected.

image

Could you try enable the 2-factor auth for your GitHub account? You can find it in the Settings > Security

Trying.....
But I found no +86(China) for sms

@yihong0618
Copy link
Author

It should be verified before. The account already connected.

image

Could you try enable the 2-factor auth for your GitHub account? You can find it in the Settings > Security

And I think you can disconnect and connect another Github account for test.
Before that you should logout your github account in chrome because leetcode connect will read your session

@jdneo
Copy link

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.

Copy link

@jdneojdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Well Done!

_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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

leetcode -> LeetCode

});
_request('https://www.linkedin.com', function(e, resp, body) {
if ( resp.statusCode !== 200) {
return cb('Get linkedin session failed');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

linkedin -> LinkedIn

}
const authenticityToken = body.match(/input name="loginCsrfParam" value="(.*)" /);
if (authenticityToken === null) {
return cb('Get Linkedin token failed');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LinkedIn

_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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LinkedIn

LeetCode

Copy link
Author

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 ~

@yihong0618
Copy link
Author

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.

OK, seems a little hard but I will try.
And facebook way I think it is not worth because I usem.facebook.com a hack way to login.
Although successful but cause the facebook security alert, so I deleted the method.

@jdneo
Copy link

Yes, no need to support facebook at this time. GitHub and LinkedIn are good enough!

@jdneo
Copy link

Thank you@yihong0618.

Would you like me to publish a new release for this change?

@jdneojdneo merged commit1f26fbd intoleetcode-tools:masterDec 24, 2019
@yihong0618
Copy link
Author

Yes.
And I found a way to solve the two-factor code. But it will use another package.
And I am not sure if it could be work in vscode-leetcode.
So I will have another pr, can you help me with that to check if the two-factor can be used in vscode-leetcode.
Thank you very much. The new pr will send in 10-20 minutes.
Thanks again.

@jdneo
Copy link

@yihong0618 Sure! Will the PR you mentioned be raised in this repo?

@yihong0618
Copy link
Author

@jdneo
Yes, see this#35
Thank you very much!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zhencode1zhencode1zhencode1 approved these changes

@jdneojdneojdneo approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@yihong0618@jdneo@zhencode1

[8]ページ先頭

©2009-2025 Movatter.jp