Auth

Auth

Authenticate an app via different auth strategies

Constructor

new Auth()

Source:
Example
const Auth = require('@tillhub/node-sdk').v1.Auth
const auth = new Auth ()

auth.loginServiceAccount('EDDB2494C2434EFE948655D6BA27E69A', '1c01a976-d133-4814-9b66-bbbda9f7bb64', (err, body) => {
  if (err) throw err
  console.log(body.token)
  console.log(body.user)
})

Extends

Methods

loginServiceAccount(clientAccount, apiKey, callbackopt)

Authenticate as headless service account.

Parameters:
Name Type Attributes Description
clientAccount String

tillhub client account uuid

apiKey String

name of service account (a type of user in the registered in the client account)

callback authCallback <optional>

optional callback

Source:

loginUsername(username, password, callbackopt)

Authenticate by username

Parameters:
Name Type Attributes Description
username String

the tillhub client account e-mail address

password String

the password corresponding to the tillhub client account\

callback authCallback <optional>

optional callback

Source: