Fix u2f tests

pull/7/head
Clement Michaud 2017-01-21 21:57:48 +01:00
parent 631b201229
commit 3d82cef30b
2 changed files with 4 additions and 3 deletions

View File

@ -162,7 +162,8 @@ function sign(req, res) {
req.session.auth_session.second_factor = true;
res.status(204);
res.send();
}, function(err) {
})
.catch(function(err) {
logger.error('U2F sign: %s', err);
res.status(401);
res.send();

View File

@ -220,7 +220,7 @@ describe('test u2f routes', function() {
req.session.auth_session.sign_request = {};
req.app.get.withArgs('u2f').returns(u2f_mock);
u2f.register(req, res);
u2f.sign(req, res);
});
it('should return unauthorized error when no sign request has been initiated', function(done) {
@ -234,7 +234,7 @@ describe('test u2f routes', function() {
u2f_mock.finishAuthentication.returns(Promise.resolve());
req.app.get.withArgs('u2f').returns(u2f_mock);
u2f.register(req, res);
u2f.sign(req, res);
});
}
});