0.2.0 • Published 7 months ago

@youngdevmg/react-authy v0.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

React Authy.mg Component

this project contains all react components for the Authy.mg authentication platform

Components

-LogWith(button to authenticate with Authy.mg platform)

Usage

LogWith

  • you must have a token decoding module to decode response token, for example: jwtDecode from jwt-decode.
  • the info parameter must contain the attributes you need (Name,LastName,...).
  • the callbak function receives a function (responseAuth) to execute after the authentication has succeeded and sends the data in the argument (response:any|decode) of this one.
  • This still contains a lot of parameters but these are the most essential.
import { LogWith } from "@mofogasy70/react-authy";
import jwtDecode from "jwt-decode";
const responseAuth = (response:any) => {
        let decode:any;
        try {
            decode=jwtDecode(response);
        } catch (error) {
            alert(error);
        }
    }
export default function LogWithExample() {
  return (
    <div>
        <LogWith 
        info={["Name","LastName","Avatar"]}
         callback={responseAuth}
          />
    </div>
  );
}

Support

thanks you for using Authy.mg platform.