@@ -73,7 +73,7 @@ Service_.prototype.setTokenFormat = function(tokenFormat) {
73
73
} ;
74
74
75
75
/**
76
- * Sets the additional HTTP headers that should be sent when retrieving or
76
+ * Sets the additional HTTP headers that should be sent when retrieving or
77
77
* refreshing the access token.
78
78
* @param Object.<string,string> tokenHeaders A map of header names to values.
79
79
* @return {Service_ } This service, for chaining.
@@ -197,7 +197,7 @@ Service_.prototype.setPrivateKey = function(privateKey) {
197
197
} ;
198
198
199
199
/**
200
- * Sets the issuer (iss) value to use for Service Account authorization.
200
+ * Sets the issuer (iss) value to use for Service Account authorization.
201
201
* If not set the client ID will be used instead.
202
202
* @param {string } issuer This issuer value
203
203
* @return {Service_ } This service, for chaining.
@@ -208,7 +208,7 @@ Service_.prototype.setIssuer = function(issuer) {
208
208
} ;
209
209
210
210
/**
211
- * Sets the subject (sub) value to use for Service Account authorization.
211
+ * Sets the subject (sub) value to use for Service Account authorization.
212
212
* @param {string } subject This subject value
213
213
* @return {Service_ } This service, for chaining.
214
214
*/
@@ -505,7 +505,7 @@ Service_.prototype.isExpired_ = function(token) {
505
505
if ( ! expires_in ) {
506
506
return false ;
507
507
} else {
508
- var expires_time = token . granted_time + expires_in ;
508
+ var expires_time = token . granted_time + Number ( expires_in ) ;
509
509
var now = getTimeInSeconds_ ( new Date ( ) ) ;
510
510
return expires_time - now < Service_ . EXPIRATION_BUFFER_SECONDS_ ;
511
511
}
@@ -577,4 +577,4 @@ Service_.prototype.createJwt_ = function() {
577
577
var signatureBytes = Utilities . computeRsaSha256Signature ( toSign , this . privateKey_ ) ;
578
578
var signature = Utilities . base64EncodeWebSafe ( signatureBytes ) ;
579
579
return toSign + '.' + signature ;
580
- } ;
580
+ } ;
0 commit comments