dist/corbel.with-polyfills.js
function(tokenObject) {
                var that = this;

                if (this.driver._refreshHandlerPromise) {
                    return this.driver._refreshHandlerPromise;
                }

                if (tokenObject.refreshToken) {
                    console.log('corbeljs:services:token:refresh');
                    this.driver._refreshHandlerPromise = this.driver.iam.token().refresh(
                        tokenObject.refreshToken,
                        this.driver.config.get(corbel.Iam.IAM_TOKEN_SCOPES, '')
                    );

                } else {
                    console.log('corbeljs:services:token:create');
                    this.driver._refreshHandlerPromise = this.driver.iam.token().create();
                }

                return this.driver._refreshHandlerPromise
                    .then(function(response) {
                        that.driver.trigger('token:refresh', response.data);
                        that.driver._refreshHandlerPromise = null;
                        return response;
                    }).catch(function(err) {
                        that.driver._refreshHandlerPromise = null;
                        throw err;
                    });
            }
function(tokenObject) {
                var that = this;

                if (this.driver._refreshHandlerPromise) {
                    return this.driver._refreshHandlerPromise;
                }

                if (tokenObject.refreshToken) {
                    console.log('corbeljs:services:token:refresh');
                    this.driver._refreshHandlerPromise = this.driver.iam.token().refresh(
                        tokenObject.refreshToken,
                        this.driver.config.get(corbel.Iam.IAM_TOKEN_SCOPES, '')
                    );

                } else {
                    console.log('corbeljs:services:token:create');
                    this.driver._refreshHandlerPromise = this.driver.iam.token().create();
                }

                return this.driver._refreshHandlerPromise
                    .then(function(response) {
                        that.driver.trigger('token:refresh', response.data);
                        that.driver._refreshHandlerPromise = null;
                        return response;
                    }).catch(function(err) {
                        that.driver._refreshHandlerPromise = null;
                        throw err;
                    });
            }
function ( tokenObject ) { var that = this ; if ( this . driver . _refreshHandlerPromise ) { return this . driver . _refreshHandlerPromise ; } if ( tokenObject . refreshToken ) { console . log ( 'corbeljs:services:token:refresh' ) ; this . driver . _refreshHandlerPromise = this . driver . iam . token ( ) . refresh ( tokenObject . refreshToken , this . driver . config . get ( corbel . Iam . IAM_TOKEN_SCOPES , '' ) ) ; } else { console . log ( 'corbeljs:services:token:create' ) ; this . driver . _refreshHandlerPromise = this . driver . iam . token ( ) . create ( ) ; } return this . driver . _refreshHandlerPromise . then ( function ( response ) { that . driver . trigger ( 'token:refresh' , response . data ) ; that . driver . _refreshHandlerPromise = null ; return response ; } ) . catch ( function ( err ) { that . driver . _refreshHandlerPromise = null ; throw err ; } ) ; }
Default token refresh handler
Only requested once at the same time
@return {Promise}
Default token refresh handler Only requested once at the same time