Skip to content

Commit

Permalink
Prevent auth.installationId from being used when using masterKey
Browse files Browse the repository at this point in the history
This allows masterKey to update any installation object
Fixes ParsePlatform/parse-server#parse-community#2887
  • Loading branch information
JeremyPlease committed Oct 19, 2016
1 parent bfb3457 commit 2484b83
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/RestWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,12 @@ RestWrite.prototype.handleInstallation = function() {
this.data.installationId = this.data.installationId.toLowerCase();
}

// If data.installationId is not set, we can lookup in the auth
let installationId = this.data.installationId || this.auth.installationId;
let installationId = this.data.installationId;

// If data.installationId is not set and we're not master, we can lookup in auth
if (!installationId && !this.auth.isMaster) {
installationId = this.auth.installationId;
}

if (installationId) {
installationId = installationId.toLowerCase();
Expand Down

0 comments on commit 2484b83

Please sign in to comment.