Skip to content

Commit 70cfb2b

Browse files
author
Eric Koleda
committed
Release version 19.
1 parent 30e0f01 commit 70cfb2b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

dist/OAuth2.gs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Service_.prototype.setTokenHeaders = function(tokenHeaders) {
159159
*/
160160
Service_.prototype.setTokenPayloadHandler = function(tokenHandler) {
161161
this.tokenPayloadHandler_ = tokenHandler;
162-
return this;
162+
return this;
163163
};
164164

165165
/**
@@ -322,7 +322,7 @@ Service_.prototype.getAuthorizationUrl = function() {
322322
'Authorization base URL': this.authorizationBaseUrl_
323323
});
324324

325-
var redirectUri = getRedirectUri(this.projectKey_);
325+
var redirectUri = this.getRedirectUri();
326326
var state = eval('Script' + 'App').newStateToken()
327327
.withMethod(this.callbackFunctionName_)
328328
.withArgument('serviceName', this.serviceName_)
@@ -359,7 +359,7 @@ Service_.prototype.handleCallback = function(callbackRequest) {
359359
'Project key': this.projectKey_,
360360
'Token URL': this.tokenUrl_
361361
});
362-
var redirectUri = getRedirectUri(this.projectKey_);
362+
var redirectUri = this.getRedirectUri();
363363
var headers = {
364364
'Accept': this.tokenFormat_
365365
};
@@ -451,11 +451,21 @@ Service_.prototype.getLastError = function() {
451451
return this.lastError_;
452452
};
453453

454+
/**
455+
* Gets the last error that occurred this execution when trying to automatically refresh
456+
* or generate an access token.
457+
* @return {Exception} An error, if any.
458+
*/
459+
Service_.prototype.getRedirectUri = function() {
460+
return getRedirectUri(this.projectKey_);
461+
};
462+
454463
/**
455464
* Gets the token from a UrlFetchApp response.
456465
* @param {UrlFetchApp.HTTPResponse} response The response object.
457466
* @return {Object} The parsed token.
458467
* @throws If the token cannot be parsed or the response contained an error.
468+
* @private
459469
*/
460470
Service_.prototype.getTokenFromResponse_ = function(response) {
461471
var token = this.parseToken_(response.getContentText());

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apps-script-oauth2",
3-
"version": "1.17.0",
3+
"version": "1.19.0",
44
"description": "OAuth2 for Apps Script is a library for Google Apps Script that provides the ability to create and authorize OAuth2 tokens as well as refresh them when they expire.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)