src/interactive-auth.js
/**
 * Abstracts the logic used to drive the interactive auth process.
 *
 * <p>Components implementing an interactive auth flow should instantiate one of
 * these, passing in the necessary callbacks to the constructor. They should
 * then call attemptAuth, which will return a promise which will resolve or
 * reject when the interactive-auth process completes.
 *
 * <p>Meanwhile, calls will be made to the startAuthStage and doRequest
 * callbacks, and information gathered from the user can be submitted with
 * submitAuthDict.
 *
 * @constructor
 * @alias module:interactive-auth
 *
 * @param {object} opts  options object
 *
 * @param {object?} opts.authData error response from the last request. If
 *    null, a request will be made with no auth before starting.
 *
 * @param {function(object?): module:client.Promise} opts.doRequest
 *     called with the new auth dict to submit the request. Should return a
 *     promise which resolves to the successful response or rejects with a
 *     MatrixError.
 *
 * @param {function(string, object?)} opts.startAuthStage
 *     called to ask the UI to start a particular auth stage. The arguments
 *     are: the login type (eg m.login.password); and (if the last request
 *     returned an error), an error object, with fields 'errcode' and 'error'.
 *
 */
Abstracts the logic used to drive the interactive auth process.
Components implementing an interactive auth flow should instantiate one of
these, passing in the necessary callbacks to the constructor. They should
then call attemptAuth, which will return a promise which will resolve or
reject when the interactive-auth process completes.

Meanwhile, calls will be made to the startAuthStage and doRequest
callbacks, and information gathered from the user can be submitted with
submitAuthDict.

@constructor
@alias module:interactive-auth

@param {object} opts  options object

@param {object?} opts.authData error response from the last request. If
null, a request will be made with no auth before starting.



@param {function(string, object?)} opts.startAuthStage
called to ask the UI to start a particular auth stage. The arguments
are: the login type ; and (if the last request
returned an error), an error object, with fields 'errcode' and 'error'.
Abstracts the logic used to drive the interactive auth process . Components implementing an interactive auth flow should instantiate one of these passing in the necessary callbacks to the constructor . They should then call attemptAuth which will return a promise which will resolve or reject when the interactive - auth process completes . Meanwhile calls will be made to the startAuthStage and doRequest callbacks and information gathered from the user can be submitted with submitAuthDict . @constructor @alias module : interactive - auth @param { object } opts options object @param { object? } opts . authData error response from the last request . If null a request will be made with no auth before starting . @param { function ( string object? ) } opts . startAuthStage called to ask the UI to start a particular auth stage . The arguments are : the login type ; and ( if the last request returned an error ) an error object with fields ' errcode ' and ' error ' .
function InteractiveAuth(opts) {
    this._data = opts.authData;
    this._requestCallback = opts.doRequest;
    this._startAuthStageCallback = opts.startAuthStage;
    this._completionDeferred = null;
}
function InteractiveAuth ( opts ) { this . _data = opts . authData ; this . _requestCallback = opts . doRequest ; this . _startAuthStageCallback = opts . startAuthStage ; this . _completionDeferred = null ; }
Abstracts the logic used to drive the interactive auth process.
Abstracts the logic used to drive the interactive auth process .