Connection to UnityBase server for asynchronous clients (NodeJS, Browser)

Classes

Types

# authParamsCallback (connUBConnection, isRepeatboolean) inner

Called by UBConnection on first authorized request.

Must return promise what resolves to object with authSchema and other schema-depending authorization parameters, for example for UB schema: {authSchema: 'UB', login: login, password: password }

For anonymous requests (when authorization is turned off for application) should return promise, resolved to {authSchema: 'None'}

Arguments:
  • conn: UBConnection
  • isRepeat: boolean

    true in case first auth request is invalid (wrong credentials returned in previous callback result)

# request2faCallback (connUBConnection, sessionUBSession, secondFactorConfirmationMethodstring, isRepeatboolean) inner

Called by UBConnection in case 2FA confirmation is required.

In case second factor confirmation method is 'Code' callback should ask user for confirmation code and return code, for 'App' method callback should show a message like 'Please, confirm login on your device and press Continue' and resolves after user press Continue

Arguments: