Auth login json response
This commit is contained in:
parent
73964ac387
commit
666928b1a9
|
@ -44,11 +44,11 @@ module.exports = function(app) {
|
||||||
if (!loginUrl)
|
if (!loginUrl)
|
||||||
loginUrl = applications.default;
|
loginUrl = applications.default;
|
||||||
|
|
||||||
res.send(JSON.stringify({
|
res.json({
|
||||||
token: token.id,
|
token: token.id,
|
||||||
continue: query.continue,
|
continue: query.continue,
|
||||||
loginUrl: loginUrl
|
loginUrl: loginUrl
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
function findCb(err, instance) {
|
function findCb(err, instance) {
|
||||||
if (!instance || instance.password !== md5(password)) {
|
if (!instance || instance.password !== md5(password)) {
|
||||||
|
@ -69,9 +69,9 @@ module.exports = function(app) {
|
||||||
}
|
}
|
||||||
function badLogin() {
|
function badLogin() {
|
||||||
res.status(401);
|
res.status(401);
|
||||||
res.send(JSON.stringify({
|
res.json({
|
||||||
message: 'Login failed'
|
message: 'Login failed'
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue