You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/07 20:04:35 UTC
[incubator-ponymail-foal] 07/10: Implement logout feature
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
commit a0c85c791b46ae93155b714162271a54ba1cf9e8
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Sep 7 22:02:38 2020 +0200
Implement logout feature
---
server/endpoints/preferences.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/server/endpoints/preferences.py b/server/endpoints/preferences.py
index 9e6a965..7908a22 100644
--- a/server/endpoints/preferences.py
+++ b/server/endpoints/preferences.py
@@ -48,6 +48,16 @@ async def process(
}
}
+ # Logging out??
+ if indata.get('logout'):
+ # Remove session from ElasticSearch
+ await plugins.session.remove_session(session)
+
+ # If stored in memory, remove from there.
+ if session.cookie in server.data.sessions:
+ del server.data.sessions[session.cookie]
+ session.credentials = None
+
return prefs