From 666928b1a9ec924e5dee66d7156d4eb158456c31 Mon Sep 17 00:00:00 2001 From: Joan Date: Tue, 3 Oct 2017 14:44:11 +0200 Subject: [PATCH] Auth login json response --- services/auth/server/boot/routes.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/auth/server/boot/routes.js b/services/auth/server/boot/routes.js index f9b690b6d..2bb25ef34 100644 --- a/services/auth/server/boot/routes.js +++ b/services/auth/server/boot/routes.js @@ -44,11 +44,11 @@ module.exports = function(app) { if (!loginUrl) loginUrl = applications.default; - res.send(JSON.stringify({ + res.json({ token: token.id, continue: query.continue, loginUrl: loginUrl - })); + }); } function findCb(err, instance) { if (!instance || instance.password !== md5(password)) { @@ -69,9 +69,9 @@ module.exports = function(app) { } function badLogin() { res.status(401); - res.send(JSON.stringify({ + res.json({ message: 'Login failed' - })); + }); } });