Reputation: 1512
I followed this tutorial on how to set up a google analytics dashboard on my site using javascript and it is working.
I've only had to click the authenticate button once several days ago and it continues to keep me logged in. I haven't found a way to add a "log out" or "deauthorize" button. How do I do that?
I'm looking at the documentation for gapi.analytics.auth and see authorize and isAuthorized, but nothing for logout.
Upvotes: 3
Views: 1394
Reputation: 30431
The Embed API does not currently support a sign out feature, but you should be able to accomplish this manually by calling the underlying gapi.auth.signOut()
method yourself.
Note there may be some weirdness if you try to log back in without refreshing the page (I'm not sure because I haven't tested this fully).
The Embed API's auth component now officially supports a signOut
method, so you can just use that instead.
Upvotes: 7