Complete logout

This commit is contained in:
Théo Piboubès
2015-09-04 18:23:10 +02:00
parent eaed514208
commit b643ce9559
2 changed files with 7 additions and 0 deletions

View File

@@ -94,6 +94,12 @@ class OAuthTool(object):
with open(self.config_fp, 'w') as cfg:
self.config.write(cfg)
def clear_oauth_data(self):
self.open_config(update=True)
if self.config.has_section('oauth') and self.config.has_option('oauth', 'refresh_token'):
self.config.remove_option('oauth', 'refresh_token')
self.save_config()
def authorize(self):
if self.compact and not '.compact' in self.reddit.config.API_PATHS['authorize']:
self.reddit.config.API_PATHS['authorize'] += '.compact'

View File

@@ -352,6 +352,7 @@ class BasePage(object):
if self.reddit.is_oauth_session():
self.reddit.clear_authentication()
self.oauth.clear_oauth_data()
return
self.oauth.authorize()