1.0.7 • Published 4 years ago

multipass-qauth-frontend-lib v1.0.7

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

multipass-oauth-frontend-lib

Front end lib for using multipas auth


Requirements

For development, you will only need Node.js and a node global package, Yarn or npm, installed in your environement.

Install

yarn add multipass-oauth-frontend-lib
or 
npm i multipass-oauth-frontend-lib

Configure app

1) you need to import { MultipassLib } from "multipass-oauth-frontend-lib"

To upload a file

MultipassLib.uploadFile(multipass, password)

PARAMS multipass - multipass zip file password - password for multipass

After upload a file that you can log in or register

Register

	Call MultipassLib.signUp() after upload multipass and wtired password

Log in

	You need to pull the email from multipass or write your email and call the method MultipassLib.authEmail(email)

Get QR code

	Call method 
    MultipassLib.getQRCode(
      token || null,
      QRContainer,
      { width: 200, height: 200 } - (params),
      "https://qr-auth.wdia.org/app" - (base link),
    )

PARAMS token - token for auth QRContainer - container for QR code rendering params - params for style qr code base link - link for a qr code redirect

After you need to go to the qr code link and execute the MultipassLib.checkToken(token), you will get a pin that you will need to enter next

Sign in authorization in the service

MultipassLib.signIn(token || null, pin) authorization in the service, you will get the result array if the first value is 1 then you are successfully logged in

Running the project

$ yarn start

Simple build for production

$ yarn build