@22u/react-twitter-auth 中文文档教程

发布于 7年前 浏览 26 项目主页 更新于 3年前

NPM

构建状态代码气候依赖状态覆盖状态npm 版本License

React Twitter Authentication Component

用于 React

Installation

npm install 的 React Twitter oAUth 登录/登录组件react-twitter-auth

Usage

```jsx 和谐

Custom content that overrides default content:

jsx 和谐自定义 Twitter 登录 内容 ```

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
loginUrlstringURL that will be used to finish 3rd step of authentication process
requestTokenUrlstringURL that will be used to get request token
onFailurefunctionfunction that will be called if user cannot be authenticated
onSuccessfunctionfunction that will be called if user is successfully authenticated
disabledbooleanfalsedisable component
styleobjectstyle object
classNamestringclass name for component
dialogWidthnumber600dialog width
dialogHeightnumber400dialog height
showIconbooltrueshould default icon be visible
credentialsstringsame-originindicates whether the user agent should send cookies from the other domain in the case of cross-origin requests. Possible values: omit, same-origin, include
customHeadersobject{}custom headers should be object with fields that needs to be sent to user server. Field name will be used as header key and field value as header value. Because of bug in fetch implementation all keys will be lowercase.
childrennodethis props can be used in order to override default component content

Examples

完整示例可以在 example 文件夹中找到。

您可以找到详细说明如何使用 RESTful 后端实施 Twitter 身份验证的教程 此处

Workflow

整个过程的详细解释可以在推特文档中找到。 在下图中,您可以找到所需的所有步骤。

Twitter authentication workflow

License

react-twitter-auth 在MIT 许可证

NPM

Build StatusCode ClimateDependency StatusCoverage Statusnpm versionLicense

React Twitter Authentication Component

A React Twitter oAUth Sign-in / Log-in Component for React

Installation

npm install react-twitter-auth

Usage

```jsx harmony

Custom content that overrides default content:

jsx harmonyCustom Twitter Login content```

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
loginUrlstringURL that will be used to finish 3rd step of authentication process
requestTokenUrlstringURL that will be used to get request token
onFailurefunctionfunction that will be called if user cannot be authenticated
onSuccessfunctionfunction that will be called if user is successfully authenticated
disabledbooleanfalsedisable component
styleobjectstyle object
classNamestringclass name for component
dialogWidthnumber600dialog width
dialogHeightnumber400dialog height
showIconbooltrueshould default icon be visible
credentialsstringsame-originindicates whether the user agent should send cookies from the other domain in the case of cross-origin requests. Possible values: omit, same-origin, include
customHeadersobject{}custom headers should be object with fields that needs to be sent to user server. Field name will be used as header key and field value as header value. Because of bug in fetch implementation all keys will be lowercase.
childrennodethis props can be used in order to override default component content

Examples

Full example can be found in example folder.

You can find tutorial that explains in details how to implement Twitter authentication with RESTful backend here.

Workflow

The detailed explanation of the whole process can be found in Twitter documentation. In picture below you can find out all the steps that are needed.

Twitter authentication workflow

License

react-twitter-auth is released under MIT License.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文