A Codechef OAuth Sign-in / Log-in Component for React
npm install --save react-codechef-login
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;
{string}
required
Client ID for Codechef OAuth application
{string}
required
Client Secret for Codechef OAuth application
{string}
required
Registered redirect URI for Codechef OAuth application
{string}
required
State parameter for your application
{string}
Text to display on the button
{string}
CSS class for login button
{function}
required
Callback for successful login
{function}
required
Callback for errors raised during login
MIT © JayjeetAtGithub