Additional validation / API error consistency fix
This commit is contained in:
parent
88a6541ab6
commit
0c5bb03dcc
3
index.js
3
index.js
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user