Clear the session-user cache when changing _User objects

This commit is contained in:
Fosco Marotto
2016-03-17 02:06:26 -07:00
parent 40812e2f53
commit 877d29daf8
2 changed files with 28 additions and 1 deletions

View File

@@ -341,6 +341,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) {