refresh(refreshToken) {

    // use the provided refresh token, or the current
    // one that we have for this class
    refreshToken = u.thisOrThat(refreshToken, this.refreshToken);

    return this.getToken(TOKEN.REFRESH, {
      refreshToken: refreshToken
    }).then(data => {
      // only set the internal refresh token if reddit
      // agrees that it was OK and sends back authData
      this.refreshToken = refreshToken;

      this.accessToken = data.access_token;
      this.tokenType = data.token_type;

      this.emit('access_token_refreshed', this.accessToken);
    });
  }
/*
     Authenticate with a refresh token.
   */
Authenticate with a refresh token.
Authenticate with a refresh token .
refresh(refreshToken) {
    refreshToken = u.thisOrThat(refreshToken, this.refreshToken);
    return this.getToken(TOKEN.REFRESH, {
      refreshToken: refreshToken
    }).then(data => {
      this.refreshToken = refreshToken;
      this.accessToken = data.access_token;
      this.tokenType = data.token_type;
      this.emit('access_token_refreshed', this.accessToken);
    });
  }
refresh ( refreshToken ) { refreshToken = u . thisOrThat ( refreshToken , this . refreshToken ) ; return this . getToken ( TOKEN . REFRESH , { refreshToken : refreshToken } ) . then ( data => { this . refreshToken = refreshToken ; this . accessToken = data . access_token ; this . tokenType = data . token_type ; this . emit ( 'access_token_refreshed' , this . accessToken ) ; } ) ; }
Authenticate with a refresh token.
Authenticate with a refresh token .
// use the provided refresh token, or the current // one that we have for this class // only set the internal refresh token if reddit // agrees that it was OK and sends back authData