From 3d82cef30b23985a7bc56141548b1d7f1299a449 Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sat, 21 Jan 2017 21:57:48 +0100 Subject: [PATCH] Fix u2f tests --- src/lib/routes/u2f.js | 3 ++- test/unitary/routes/test_u2f.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/routes/u2f.js b/src/lib/routes/u2f.js index 6cca442e..0f504fa2 100644 --- a/src/lib/routes/u2f.js +++ b/src/lib/routes/u2f.js @@ -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(); diff --git a/test/unitary/routes/test_u2f.js b/test/unitary/routes/test_u2f.js index 1c26c1cb..4d28ee04 100644 --- a/test/unitary/routes/test_u2f.js +++ b/test/unitary/routes/test_u2f.js @@ -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); }); } });