Additional validation / API error consistency fix

This commit is contained in:
Hannah Wolfe 2013-08-26 21:28:50 +01:00
parent 88a6541ab6
commit 0c5bb03dcc

View File

@ -81,8 +81,7 @@ function cleanNotifications(req, res, next) {
function authAPI(req, res, next) {
if (!req.session.user) {
// TODO: standardize error format/codes/messages
var err = { code: 42, message: 'Please sign in' };
res.json(401, { error: err });
res.json(401, { error: 'Please sign in' });
return;
}