1.0.6 • Published 7 years ago

myminifactory-login v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

React MyMiniFactory Login

GitHub NpmVersion

React component for MyMiniFactory login.

Example

Just simply import the React Component like so:

import React from 'react';
import ReactDOM from 'react-dom';
import MyMiniFactoryLogin from 'myminifactory-login';


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


ReactDOM.render(
    <MyMiniFactoryLogin
        clientKey=""
        redirectUri=""
        onSuccess={onSuccess}
        onFailure={onFailure}
    />,
    document.getElementById('example')
);

Props

PropTypeExplication
clientKey{string} requiredClient ID for MyMiniFactory OAuth application.
redirectUri{string} requiredRegistered redirect URI for MyMiniFactory OAuth application.
className{string}CSS class for the login button.
buttonText{string}Text content for the login button.
onSuccess{function}Callback for successful login. An object will be passed as an argument to the callback, e.g. { "access_token": "..." }.
onFailure{function}Callback for errors raised during login.