Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 50 additions & 48 deletions build/ringcentral.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/ringcentral.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/ringcentral.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/ringcentral.min.js.map

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions src/platform/Platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,14 @@ Platform.prototype._refresh = function() {
if (!this._auth.refreshToken()) throw new Error('Refresh token is missing');
if (!this._auth.refreshTokenValid()) throw new Error('Refresh token has expired');

return this._tokenRequest(Platform._tokenEndpoint, {
"grant_type": "refresh_token",
"refresh_token": this._auth.refreshToken(),
"access_token_ttl": this._auth.data().expires_in + 1,
"refresh_token_ttl": this._auth.data().refresh_token_expires_in + 1
});
if (this._appKey && this._appSecret) {
return this._tokenRequest(Platform._tokenEndpoint, {
"grant_type": "refresh_token",
"refresh_token": this._auth.refreshToken(),
"access_token_ttl": this._auth.data().expires_in + 1,
"refresh_token_ttl": this._auth.data().refresh_token_expires_in + 1
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if otherwise? The rest of the function relies on fact that there is a response.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you still interested in this PR? Can you fix it or should I close?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will close this.


}.bind(this)).then(function(/** @type {ApiResponse} */ res) {

Expand Down