Skip to content

Commit

Permalink
fix(RestWrite): make method async as expected in usage (parse-communi…
Browse files Browse the repository at this point in the history
…ty#6025)

The method `createSessionToken` in RestWrite.js is assumed to always return a promise (see Line 961 in `handleFollowUp`) - this was throwing an error `cannot read 'then' of undefined`. This simply one word change fixes that error.
  • Loading branch information
omairvaiyani authored and davimacedo committed Sep 4, 2019
1 parent 9865f02 commit afa6c13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RestWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ RestWrite.prototype.createSessionTokenIfNeeded = function() {
return this.createSessionToken();
};

RestWrite.prototype.createSessionToken = function() {
RestWrite.prototype.createSessionToken = async function() {
// cloud installationId from Cloud Code,
// never create session tokens from there.
if (this.auth.installationId && this.auth.installationId === 'cloud') {
Expand Down

0 comments on commit afa6c13

Please sign in to comment.