react-login-github
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

This is a fork of react-github-login since the project seems to be abandoned. This fork includes:

  • Updated React > 16.0.0 and all other dependencies.
  • Popup custom position.
  • Popup auto-center by default.
  • Disable button property.

React Login with Github

NPM CircleCI

React component for GitHub Login.

Usage

The easiest way to use react-login-github is to install it from npm and build it into your app with webpack:

yarn add react-login-github

or using npm:

npm install react-login-github --save

Then use it in your app:

import React from 'react';
import ReactDOM from 'react-dom';
import LoginGithub from 'react-login-github';

const onSuccess = response => console.log(response);
const onFailure = response => console.error(response);

ReactDOM.render(
  <LoginGithub clientId="ac56fad434a3a3c1561e"
    onSuccess={onSuccess}
    onFailure={onFailure}
  />,
  document.getElementById('example')
);

Props

clientId

{string} required

Client ID for GitHub OAuth application.

redirectUri

{string}

Registered redirect URI for GitHub OAuth application.

scope

{string}

Scope for GitHub OAuth application. Defaults to user:email.

className

{string}

CSS class for the login button.

buttonText

{string}

Text content for the login button.

onRequest

{function}

Callback for every request.

onSuccess

{function}

Callback for successful login. An object will be passed as an argument to the callback, e.g. { "code": "..." }.

onFailure

{function}

Callback for errors raised during login.

disabled

{bool}

Disable login button.

Development

$ npm start

Package Sidebar

Install

npm i react-login-github

Weekly Downloads

272

Version

1.0.8

License

MIT

Unpacked Size

20.7 kB

Total Files

24

Last publish

Collaborators

  • rlamana