Skip to content

donmorton/github-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

React GitHub Login

NPM Codacy Badge FOSSA Status

React component for GitHub login.

This project originally created and maintained by Checkr. However, after over a year of inactivity it appears this repository is abandoned. With many issues open, I decided to clone and maintain this repo myself.

Credit goes to Kurt Ruppel from Checkr for being the original developer on the project.

This project is now being updated and maintained by donmorton

Usage

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

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

ReactDOM.render(
  <GitHubLogin 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.

Development

$ npm start

Webpack development server starts at http://localhost:8080, loading example/index.html.

License

FOSSA Status