From 0a07acfcf2bcb9409920a1f98d8c1a3d4bbb423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 16 May 2014 23:11:09 +0200 Subject: [PATCH] [fix] Return a string on log in/out in the api for json encoding --- moulinette/interfaces/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 917bcbc0..13b66b1e 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -228,7 +228,7 @@ class _ActionsMapPlugin(object): response.set_cookie('session.id', s_id, secure=True) response.set_cookie('session.hashes', s_hashes, secure=True, secret=s_secret) - raise HTTPOKResponse(m18n.g('logged_in')) + return m18n.g('logged_in') def logout(self, profile=None): """Log out from an authenticator profile @@ -250,7 +250,7 @@ class _ActionsMapPlugin(object): # Delete cookie and clean the session response.set_cookie('session.hashes', '', max_age=-1) clean_session(s_id) - raise HTTPOKResponse(m18n.g('logged_out')) + return m18n.g('logged_out') def process(self, _route, arguments={}): """Process the relevant action for the route