Added logout API function for a single account
This commit is contained in:
parent
2fc703e866
commit
646ea83410
|
@ -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:
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Reference in New Issue