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')