code: function(provider, data, { failOnNotExist = false } = {}) {
          var authType;
          if (_.isString(provider)) {
            authType = provider;
            provider = AV.User._authProviders[provider];
          } else {
            authType = provider.getAuthType();
          }
          if (data) {
            return this.save(
              { authData: { [authType]: data } },
              {
                fetchWhenSave: !!this.get('authData'),
                _failOnNotExist: failOnNotExist,
              }
            ).then(function(model) {
              return model._handleSaveResult(true).then(function() {
                return model;
              });
            });
          } else {
            return provider
              .authenticate()
              .then(result => this._linkWith(provider, result));
          }
        }
docs: Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
  call linkWith on the user (even if it doesn't exist yet on the server).
  @private