Makes sure the location in results has the proper objectId

This commit is contained in:
Florent Vilmart
2016-03-16 20:20:08 -04:00
parent d6af77b170
commit 461ddcbd05
2 changed files with 28 additions and 1 deletions

View File

@@ -285,11 +285,12 @@ RestWrite.prototype.handleAuthData = function(authData) {
// Login with auth data
// Short circuit
delete results[0].password;
// need to set the objectId first otherwise location has trailing undefined
this.data.objectId = results[0].objectId;
this.response = {
response: results[0],
location: this.location()
};
this.data.objectId = results[0].objectId;
} else if (this.query && this.query.objectId) {
// Trying to update auth data but users
// are different