Browse Source

Fix google analytics widget (#301)

* Make _lock attribute available

* Allow server-side token refresh
Wouter 7 years ago
parent
commit
cf3ceb8a3e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      jet/dashboard/dashboard_modules/google_analytics.py

+ 3 - 1
jet/dashboard/dashboard_modules/google_analytics.py

@@ -39,6 +39,7 @@ JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE = getattr(
 
 class ModuleCredentialStorage(Storage):
     def __init__(self, module):
+        super(ModuleCredentialStorage, self).__init__()
         self.module = module
 
     def locked_get(self):
@@ -73,7 +74,8 @@ class GoogleAnalyticsClient:
         self.FLOW = flow_from_clientsecrets(
             JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE,
             scope='https://www.googleapis.com/auth/analytics.readonly',
-            redirect_uri=redirect_uri
+            redirect_uri=redirect_uri,
+            prompt='consent'
         )
 
         if storage is not None: