react-codechef-login

1.3.4 • Public • Published

React Codechef Login

A Codechef OAuth Sign-in / Log-in Component for React

NPM JavaScript Style Guide

Install

npm install --save react-codechef-login

Usage

import React, { Component } from "react";
import CodechefLogin from "react-codechef-login";
import "./App.css";
 
const responseCodechef = response => {
  console.log(response);
};
 
class App extends Component {
  render() {
    return (
      <div className="App">
        <CodechefLogin
          clientId="abcd5hdy8hdb63bd"
          clientSecret="2gd5dhfbd7sn8ff"
          redirectUri="http://localhost:3000"
          state="xyzabc"
          className="my-fav-class"
          buttonText="Login Now"
          onSuccess={responseCodechef}
          onFailure={responseCodechef}
        />
      </div>
    );
  }
}
 
export default App;

Props

clientId

{string} required

Client ID for Codechef OAuth application

clientSecret

{string} required

Client Secret for Codechef OAuth application

redirectUri

{string} required

Registered redirect URI for Codechef OAuth application

state

{string} required

State parameter for your application

buttonText

{string}

Text to display on the button

className

{string}

CSS class for login button

onSuccess

{function} required

Callback for successful login

onFailure

{function} required

Callback for errors raised during login

License

MIT © JayjeetAtGithub

Package Sidebar

Install

npm i react-codechef-login

Weekly Downloads

8

Version

1.3.4

License

MIT

Unpacked Size

42.2 kB

Total Files

7

Last publish

Collaborators

  • jcnitdgp25