Skip to content
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 screen_name to popup url? #23

Open
Serexx opened this issue Jul 24, 2018 · 2 comments
Open

add screen_name to popup url? #23

Serexx opened this issue Jul 24, 2018 · 2 comments

Comments

@Serexx
Copy link
Contributor

Serexx commented Jul 24, 2018

Hey - appreciate the work, saved me a lot of fiddling, just one request :-)

As per here:
https://developer.twitter.com/en/docs/basics/authentication/api-reference/authenticate
we would like pass a screen_name param to the popup URL to prefill the screen_name input.

I think, its just a matter of adding it to TwitterLogin.propTypes and appending it to the popup url like so

popup.location = https://api.twitter.com/oauth/authenticate?oauth_token=${data.oauth_token}&force_login=${this.props.forceLogin}&screen_name=${this.props.screenName||""}`;`

if the property is not supplied the || or just passes the empty string, with no visible effect.

I'm going to clone it and give it a try (any reason I shouldn't ?) - if it works as expected do you want a pull request?

@ivanvs
Copy link
Contributor

ivanvs commented Jul 24, 2018

Hi @Serexx,

Great idea. I don't see any reason why we should not have this feature. I would be interested in PR. So go ahead!

@alexandrtovmach
Copy link
Contributor

You can try this package, which return object like this:

{
  oauth_token: "abc"
  oauth_token_secret: "def"
  screen_name: "username"
  user_id: "1234"
}

And here you can find playground:
https://alexandrtovmach.github.io/react-twitter-login/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants