diff --git a/igmirror.py b/igmirror.py index c39903b..3c3daa6 100644 --- a/igmirror.py +++ b/igmirror.py @@ -90,6 +90,10 @@ def update_allaccounts(): print() print('I| done updating all accounts') +def logout_account(acc_id): + accdata = db_get('accounts', acc_id) + del accdata['cookie'] + db_set('accounts', acc_id, accdata) def pixelfed_islogged(acc_id, accdata=None): if accdata is None: diff --git a/server.py b/server.py index 477daca..32fac39 100644 --- a/server.py +++ b/server.py @@ -26,6 +26,8 @@ class MyServer(BaseHTTPRequestHandler): igmirror.add_igaccount(accname) elif parts[1].lower() == 'update': igmirror.update_igaccount_async(accname) + elif parts[1].lower() == 'logout': + igmirror.logout_account(accname) self.wfile.write(bytes('{"status": "ok"}', "utf-8")) else: self.wfile.write(bytes('{"status": "parameters are not correct"}', "utf-8"))