make code more concise
This commit is contained in:
parent
c410793351
commit
6c0daa1e3c
1 changed files with 1 additions and 7 deletions
|
@ -24,13 +24,7 @@ router.post('/state', (req, res, next) => {
|
||||||
res.status(400).send(error);
|
res.status(400).send(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
authenticator.getAuthenticatedUser(req, (user) => {
|
authenticator.withUser(req, res, (user) => ctrl.create(req.body, user, scb, ecb));
|
||||||
if (user) {
|
|
||||||
ctrl.create(req.body, user, scb, ecb);
|
|
||||||
} else {
|
|
||||||
ecb({ code: 'auth error', message: 'user not logged in.' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/user', function (req, res, next) {
|
router.get('/user', function (req, res, next) {
|
||||||
|
|
Loading…
Reference in a new issue