From c06e1a91c9911935b51a53b9389089272c3697b5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 10 Jul 2023 21:28:54 +0200 Subject: [PATCH] auth: prevent stupid issue where outdated cookie usage would trigger error 500 intead of 401, resulting in a ~bug after Yunohost self-upgrade and the webadmin is confused about the API not being up again --- moulinette/interfaces/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 14ba0b54..34b51143 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -388,7 +388,7 @@ def logout(self): try: authenticator.get_session_cookie() - except KeyError: + except Exception: raise HTTPResponse(m18n.g("not_logged_in"), 401) else: # Delete cookie and clean the session