Permalink
Browse files

Updated JS lib to 1.1.2.

  • Loading branch information...
1 parent b520731 commit f8d7d5acad5b4957430032aca86c6fe77fb03599 @vseventer vseventer committed Oct 8, 2013
Showing with 13 additions and 12 deletions.
  1. +12 −11 kinvey.js
  2. +1 −1 package.json
View
@@ -104,7 +104,7 @@
* @type {string}
* @default
*/
- Kinvey.SDK_VERSION = '1.1.1';
+ Kinvey.SDK_VERSION = '1.1.2';
// Properties.
// -----------
@@ -139,6 +139,7 @@
// The namespaces of the Kinvey service.
var DATA_STORE = 'appdata';
var FILES = 'blob';
+ var PUSH = 'push';
var RPC = 'rpc';
var USERS = 'user';
/*var USER_GROUPS = 'group';*/
@@ -1488,7 +1489,7 @@
}
// Return the device information string.
- var parts = ['js-nodejs/1.1.1'];
+ var parts = ['js-nodejs/1.1.2'];
if(0 !== libraries.length) { // Add external library information.
parts.push('(' + libraries.sort().join(', ') + ')');
}
@@ -3299,12 +3300,6 @@
log('Logging in an existing user.', arguments);
}
- // Validate preconditions.
- if(null !== Kinvey.getActiveUser()) {
- var error = clientError(Kinvey.Error.ALREADY_LOGGED_IN);
- return Kinvey.Defer.reject(error);
- }
-
// Cast arguments.
if(isObject(usernameOrData)) {
options = 'undefined' !== typeof options ? options : password;
@@ -3323,6 +3318,12 @@
throw new Kinvey.Error('Argument must contain: username and password, or _socialIdentity.');
}
+ // Validate preconditions.
+ if(null !== Kinvey.getActiveUser()) {
+ var error = clientError(Kinvey.Error.ALREADY_LOGGED_IN);
+ return wrapCallbacks(Kinvey.Defer.reject(error), options);
+ }
+
// Login with the specified credentials.
var promise = Kinvey.Persistence.create({
namespace: USERS,
@@ -3644,7 +3645,7 @@
// If `options.state`, validate preconditions.
if(false !== options.state && null !== Kinvey.getActiveUser()) {
var error = clientError(Kinvey.Error.ALREADY_LOGGED_IN);
- return Kinvey.Defer.reject(error);
+ return wrapCallbacks(Kinvey.Defer.reject(error), options);
}
// Create the new user.
@@ -6678,8 +6679,8 @@
}
// Return the response.
- promise.then(null, options.error);
- return promise;
+ delete options.success;
+ return wrapCallbacks(promise, options);
}
// Prepare the response.
View
@@ -1,6 +1,6 @@
{
"name" : "kinvey",
- "version" : "1.1.1",
+ "version" : "1.1.2",
"description" : "Kinvey JavaScript Library for Node.js.",
"homepage" : "http://www.kinvey.com",
"bugs" : { "email": "support@kinvey.com" },

0 comments on commit f8d7d5a

Please sign in to comment.