Complete logout
This commit is contained in:
@@ -94,6 +94,12 @@ class OAuthTool(object):
|
|||||||
with open(self.config_fp, 'w') as cfg:
|
with open(self.config_fp, 'w') as cfg:
|
||||||
self.config.write(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):
|
def authorize(self):
|
||||||
if self.compact and not '.compact' in self.reddit.config.API_PATHS['authorize']:
|
if self.compact and not '.compact' in self.reddit.config.API_PATHS['authorize']:
|
||||||
self.reddit.config.API_PATHS['authorize'] += '.compact'
|
self.reddit.config.API_PATHS['authorize'] += '.compact'
|
||||||
|
|||||||
@@ -352,6 +352,7 @@ class BasePage(object):
|
|||||||
|
|
||||||
if self.reddit.is_oauth_session():
|
if self.reddit.is_oauth_session():
|
||||||
self.reddit.clear_authentication()
|
self.reddit.clear_authentication()
|
||||||
|
self.oauth.clear_oauth_data()
|
||||||
return
|
return
|
||||||
|
|
||||||
self.oauth.authorize()
|
self.oauth.authorize()
|
||||||
|
|||||||
Reference in New Issue
Block a user