JureSotosek / github-oauth-popup

A popup component for GitHub OAuth authentication.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub OAuth Popup

NPM

A popup window helper/component for GitHub login.

Inspired by and "coppied" from react-github-login.

Example

http://buildastack.io/ - Top right corner.

Install

$ yarn add github-oauth-popup

Usage

import { loginWithGithub } from 'github-oauth-popup';

const params = {
  client_id: 'id',
  scope: 'read:user'
  }
);

loginWithGithub(params).then(res => console.log('Code: ', res.code))

API

loginWithGithub(params, options?, url?, id?)

params

An object that contains the client_id and the scope requested

options

Options for the popup window

default
{
  height: 1000,
  width: 600
}

url

The auth url

default
'https://github.com/login/oauth/authorize';

id

Popup window id

default
'github-oauth-authorize';

License

MIT © Jure Sotosek

About

A popup component for GitHub OAuth authentication.

License:MIT License


Languages

Language:JavaScript 100.0%