1.0.1 • Published 3 years ago

azuriom-auth v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

AzAuth JS

Node.js CI Code QL npm Version Chat

A JavaScript implementation made in TypeScript of the Azuriom Auth API.

Installation

npm install azuriom-auth

Usage

import { AuthClient } from 'azuriom-auth'

async function login(email, password) {
  const client = new AuthClient('<url of your website>')

  let result = await client.login(email, password)

  if (result.status === 'pending' && result.requires2fa) {
    const twoFactorCode = '' // IMPORTANT: Replace with the 2FA user temporary code

    result = await client.login(email, password, twoFactorCode)
  }

  if (result.status !== 'success') {
    throw 'Unexpected result: ' + JSON.stringify(result)
  }

  return result
}
1.0.1

3 years ago

1.0.0

3 years ago

0.1.2

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago