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:
parent
745f2de25f
commit
eddd1050c4
@ -147,7 +147,7 @@ class KeyAuthService:
|
|||||||
|
|
||||||
def remove_user_token(self, email, request, env):
|
def remove_user_token(self, email, request, env):
|
||||||
# Remove the user's token from the in-memory session database.
|
# 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)
|
return KeyAuthService.__token_dict.pop(email)
|
||||||
|
|
||||||
def create_user_key(self, email, env):
|
def create_user_key(self, email, env):
|
||||||
|
@ -184,7 +184,7 @@ def bye():
|
|||||||
pass # Unauthorized users can logout too, simply do nothing.
|
pass # Unauthorized users can logout too, simply do nothing.
|
||||||
finally:
|
finally:
|
||||||
resp = Response()
|
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
|
return resp
|
||||||
|
|
||||||
# MAIL
|
# MAIL
|
||||||
|
@ -372,6 +372,7 @@ function do_logout() {
|
|||||||
localStorage.removeItem("miab-cp-credentials");
|
localStorage.removeItem("miab-cp-credentials");
|
||||||
if (typeof sessionStorage != 'undefined')
|
if (typeof sessionStorage != 'undefined')
|
||||||
sessionStorage.removeItem("miab-cp-credentials");
|
sessionStorage.removeItem("miab-cp-credentials");
|
||||||
|
api("/bye", "GET"); // Invalidate and remove control panel token.
|
||||||
show_panel('login');
|
show_panel('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user