myminifactory-login
v1.0.6
Published
A React Component for Oauth Login on MyMiniFactory.com
Maintainers
Readme
React MyMiniFactory Login
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
| Prop | Type | Explication |
| :---------- | :-------------------- | :--------------------------------------------- |
| clientKey | {string} required | Client ID for MyMiniFactory OAuth application. |
| redirectUri | {string} required | Registered 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. |
