Skip to content

Commit 77edf0a

Browse files
committed
Fix logout api call
1 parent 1e7cd7a commit 77edf0a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

syncrypt/api/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ def get_auth_check(self, request):
149149
@require_auth_token
150150
def get_auth_logout(self, request):
151151
'''
152-
Logging out the user simply works by removing the global auth
153-
token.
152+
Log out the user and remove global_auth information
154153
'''
155154
cfg = self.app.config
155+
backend = yield from self.app.open_backend()
156+
backend.global_auth = None
157+
backend.set_auth(None, None)
158+
yield from get_manager_instance().close()
156159
with cfg.update_context():
157160
cfg.update('remote', {'auth': ''})
158161
return JSONResponse({'status': 'ok'})

syncrypt/backends/binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def close(self):
789789
for conn in self.slots:
790790
if conn.connected or conn.connecting:
791791
if not logged:
792-
self.backend.logger.debug('Disconnecting from server')
792+
logger.debug('Disconnecting from server')
793793
logged = True
794794
yield from conn.disconnect()
795795
if not self._monitor_task is None:

0 commit comments

Comments
 (0)