Skip to content

Commit 3113108

Browse files
Upon service reset, also clear the cached token
If a cache is set then a token is acquired it is stored in both the Cache service and the Properties service. Therefore, when the Service is reset the token must be removed from the Cache service as well as the Properties service. Otherwise, getAccessToken() would still return the cached token after a call to reset().
1 parent 08a8d9c commit 3113108

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Service.gs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,11 @@ Service_.prototype.reset = function() {
362362
validate_({
363363
'Property store': this.propertyStore_
364364
});
365-
this.propertyStore_.deleteProperty(this.getPropertyKey_(this.serviceName_));
365+
var key = this.getPropertyKey_(this.serviceName_);
366+
this.propertyStore_.deleteProperty(key);
367+
if (this.cache_) {
368+
this.cache_.remove(key);
369+
}
366370
};
367371

368372
/**

0 commit comments

Comments
 (0)