Connection to UnityBase server for asynchronous clients (NodeJS, Browser)
Classes
Types
# authParamsCallback (conn: UBConnection, isRepeat: boolean) 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
: UBConnectionisRepeat
: booleantrue in case first auth request is invalid (wrong credentials returned in previous callback result)
# request2faCallback (conn: UBConnection, session: UBSession, secondFactorConfirmationMethod: string, isRepeat: boolean) 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:
conn
: UBConnectionsession
: UBSessionsecondFactorConfirmationMethod
: string'Code' or 'App'
isRepeat
: boolean