From 0905753b0c6d23f1dcfe910bc92466538fcf788f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 17 Feb 2015 12:47:58 +0100 Subject: [PATCH] Moving response generation from auth plugin services to auth api --- taiga/auth/api.py | 3 ++- taiga/auth/services.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/taiga/auth/api.py b/taiga/auth/api.py index f2ed0161..2663b3e0 100644 --- a/taiga/auth/api.py +++ b/taiga/auth/api.py @@ -142,6 +142,7 @@ class AuthViewSet(viewsets.ViewSet): login_type = request.DATA.get("type", None) if login_type in auth_plugins: - return auth_plugins[login_type]['login_func'](request) + data = auth_plugins[login_type]['login_func'](request) + return response.Ok(data) raise exc.BadRequest(_("invalid login type")) diff --git a/taiga/auth/services.py b/taiga/auth/services.py index 238f229f..c73dd506 100644 --- a/taiga/auth/services.py +++ b/taiga/auth/services.py @@ -201,7 +201,7 @@ def normal_login_func(request): user = get_and_validate_user(username=username, password=password) data = make_auth_response_data(user) - return response.Ok(data) + return data register_auth_plugin("normal", normal_login_func);