1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-20 02:52:11 +00:00

Call /admin/bye on logout

This commit is contained in:
NewbieOrange 2021-07-30 01:08:18 +08:00
parent 745f2de25f
commit eddd1050c4
3 changed files with 3 additions and 2 deletions

View File

@ -147,7 +147,7 @@ class KeyAuthService:
def remove_user_token(self, email, request, env):
# Remove the user's token from the in-memory session database.
# Returns the invalidated token if exists.
# Return the invalidated token if exists.
return KeyAuthService.__token_dict.pop(email)
def create_user_key(self, email, env):

View File

@ -184,7 +184,7 @@ def bye():
pass # Unauthorized users can logout too, simply do nothing.
finally:
resp = Response()
resp.set_cookie("miab-cp-token", expires=0) # Removes the token cookie
resp.set_cookie("miab-cp-token", expires=0) # Remove the token cookie
return resp
# MAIL

View File

@ -372,6 +372,7 @@ function do_logout() {
localStorage.removeItem("miab-cp-credentials");
if (typeof sessionStorage != 'undefined')
sessionStorage.removeItem("miab-cp-credentials");
api("/bye", "GET"); // Invalidate and remove control panel token.
show_panel('login');
}