parse 4.2.0-alpha.3 → 4.2.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v4.2.0-alpha.3
2
+ * Parse JavaScript SDK v4.2.0-alpha.4
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -533,7 +533,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
533
533
  SERVER_AUTH_TOKEN: null,
534
534
  LIVEQUERY_SERVER_URL: null,
535
535
  ENCRYPTED_KEY: null,
536
- VERSION: 'js' + "4.2.0-alpha.3",
536
+ VERSION: 'js' + "4.2.0-alpha.4",
537
537
  APPLICATION_ID: null,
538
538
  JAVASCRIPT_KEY: null,
539
539
  MASTER_KEY: null,
@@ -15780,6 +15780,40 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
15780
15780
  return user.logIn(options);
15781
15781
  }
15782
15782
 
15783
+ /**
15784
+ * Logs in a user with a username (or email) and password, and authData. On success, this
15785
+ * saves the session to disk, so you can retrieve the currently logged in
15786
+ * user using <code>current</code>.
15787
+ *
15788
+ * @param {string} username The username (or email) to log in with.
15789
+ * @param {string} password The password to log in with.
15790
+ * @param {object} authData The authData to log in with.
15791
+ * @param {object} options
15792
+ * @static
15793
+ * @returns {Promise} A promise that is fulfilled with the user when
15794
+ * the login completes.
15795
+ */
15796
+ }, {
15797
+ key: "logInWithAdditionalAuth",
15798
+ value: function (username /*: string*/, password /*: string*/, authData /*: AuthData*/, options /*:: ?: FullOptions*/) {
15799
+ if (typeof username !== 'string') {
15800
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
15801
+ }
15802
+ if (typeof password !== 'string') {
15803
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
15804
+ }
15805
+ if (Object.prototype.toString.call(authData) !== '[object Object]') {
15806
+ return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
15807
+ }
15808
+ var user = new this();
15809
+ user._finishFetch({
15810
+ username: username,
15811
+ password: password,
15812
+ authData: authData
15813
+ });
15814
+ return user.logIn(options);
15815
+ }
15816
+
15783
15817
  /**
15784
15818
  * Logs in a user with an objectId. On success, this saves the session
15785
15819
  * to disk, so you can retrieve the currently logged in user using
@@ -16229,7 +16263,8 @@ var DefaultController = {
16229
16263
  var stateController = _CoreManager.default.getObjectStateController();
16230
16264
  var auth = {
16231
16265
  username: user.get('username'),
16232
- password: user.get('password')
16266
+ password: user.get('password'),
16267
+ authData: user.get('authData')
16233
16268
  };
16234
16269
  return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(function (response) {
16235
16270
  user._migrateId(response.objectId);