From f2062e60efe0d6530e07092f4205065cbda8dadd Mon Sep 17 00:00:00 2001 From: Amit Agarwal Date: Thu, 27 Jun 2019 17:39:34 +0530 Subject: [PATCH] Use Cache for credentials Sets the cache to use when persisting credentials --- samples/Twitter.gs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/Twitter.gs b/samples/Twitter.gs index b4fea54..89a5e8d 100644 --- a/samples/Twitter.gs +++ b/samples/Twitter.gs @@ -49,6 +49,10 @@ function getService() { // Set the name of the callback function in the script referenced // above that should be invoked to complete the OAuth flow. .setCallbackFunction('authCallback') + + // Using a cache will reduce the need to read from + // the property store and may increase performance. + .setCache(CacheService.getUserCache()) // Set the property store where authorized tokens should be persisted. .setPropertyStore(PropertiesService.getUserProperties());