From 31131086cb70a691b0b836ec7292c60cd2dfef2e Mon Sep 17 00:00:00 2001 From: Younes Abouelnagah Date: Tue, 10 Oct 2017 16:21:34 -0400 Subject: [PATCH] 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(). --- src/Service.gs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Service.gs b/src/Service.gs index a6259a47..f186c617 100644 --- a/src/Service.gs +++ b/src/Service.gs @@ -362,7 +362,11 @@ Service_.prototype.reset = function() { validate_({ 'Property store': this.propertyStore_ }); - this.propertyStore_.deleteProperty(this.getPropertyKey_(this.serviceName_)); + var key = this.getPropertyKey_(this.serviceName_); + this.propertyStore_.deleteProperty(key); + if (this.cache_) { + this.cache_.remove(key); + } }; /**