Merge pull request #1072 from ParsePlatform/fosco.user-cache

Clear the session-user cache when changing _User objects
This commit is contained in:
Fosco Marotto
2016-03-18 08:51:51 -08:00
2 changed files with 28 additions and 1 deletions

View File

@@ -342,6 +342,11 @@ RestWrite.prototype.transformUser = function() {
});
}
// If we're updating a _User object, clear the user cache for the session
if (this.query && this.auth.user && this.auth.user.getSessionToken()) {
cache.users.remove(this.auth.user.getSessionToken());
}
return promise.then(() => {
// Transform the password
if (!this.data.password) {