From 5c1fc63e6169e404a0861cc39a790f8c4ffdc68e Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Wed, 15 Jan 2020 11:28:40 -0800 Subject: [PATCH] patch to remove timeout from login test --- server/controllers/auth.js | 3 +-- server/test/auth.spec.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/controllers/auth.js b/server/controllers/auth.js index f9e0b0d..6017abd 100644 --- a/server/controllers/auth.js +++ b/server/controllers/auth.js @@ -36,7 +36,7 @@ const login = async (req, res, next) => { const queryResults = await knex('user') .where({username: user.username}) - .select('username', 'email', 'password') + .select() .then(queryResults => queryResults); const savedUser = queryResults[0] || null; @@ -44,7 +44,6 @@ const login = async (req, res, next) => { const hashedPassword = savedUser.password; const passwordMatch = await compareHash(user.password, hashedPassword); - if (!passwordMatch) return res.status(401).json({err: 'bad credentials'}); const authorizedUser = {...savedUser}; diff --git a/server/test/auth.spec.js b/server/test/auth.spec.js index 0b466e7..383d04b 100644 --- a/server/test/auth.spec.js +++ b/server/test/auth.spec.js @@ -87,8 +87,7 @@ const authSpec = (chai, knex, server) => { }) }) - it('post to login with registered user should return cookie', function(done) { - this.timeout(5000); + it('post to login with registered user should return cookie', done => { chai.request(server) .post('/auth/signup') .type('form')