Auth login json response

This commit is contained in:
Joan Sanchez 2017-10-03 14:44:11 +02:00
parent 73964ac387
commit 666928b1a9
1 changed files with 4 additions and 4 deletions

View File

@ -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'
}));
});
}
});