1.0.1 • Published 5 years ago

@mihaben/react-twitter-auth v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

NPM

npm Build Status Code Climate Coverage Status npm version License

React Twitter Authentication Component

A React Twitter oAUth Sign-in / Log-in Component for React, implemented with Apollo

Installation

npm install mihaben/react-twitter-auth

Usage

<TwitterLogin
  onFailure={this.onFailed}
  onSuccess={this.onSuccess}
  requestTokenQuery={REQUEST_TOKEN_QUERY}
/>

Custom content that overrides default content:

<TwitterLogin
  onFailure={this.onFailed}
  onSuccess={this.onSuccess}
  requestTokenQuery={REQUEST_TOKEN_QUERY}
  showIcon={true}
>
  <b>Custom</b> Twitter <i>Login</i> content
</TwitterLogin>

Options

paramsvaluedefault valuedescription
tagstringbuttontag that should be used to create element that will be used as loging element
textstringSign in with Twittertext that will be shown in component
requestTokenQueryfunctiongql (graphql-tag) query
onFailurefunctionfunction that will be called if user cannot be authenticated
onSuccessfunctionfunction that will be called with {oauthToken, oauthVerifier}
disabledbooleanfalsedisable component
styleobjectstyle object
classNamestringclass name for component
dialogWidthnumber600dialog width
dialogHeightnumber400dialog height
showIconbooltrueshould default icon be visible
childrennodethis props can be used in order to override default component content
forceLoginboolfalseforce user to authenticate with Twitter username and password
screenNamestringprefills the username input box of the OAuth login screen with the given value

License

react-twitter-auth is released under MIT License.