
module.exports = {
  logIn: () => {
    // TODO: login authorization
  },

  logOut: () => {
    // TODO: logout currently logged in user
  },
};

@@ -1,8 +1,102 @@
+const db = require('../../../database/schemas.js');%0Aconst bcrypt = require('bcrypt-nodejs');%0A%0A
 %0Amodule.
@@ -117,16 +117,24 @@
 logIn: (
+req, res
 ) =%3E %7B%0A 
@@ -140,36 +140,371 @@
     
-// TODO: login authorization
+db.User.findOne(%7B where: %7B email: req.body.email %7D %7D)%0A    .then((user) =%3E %7B%0A      if (user) %7B%0A        if (bcrypt.compareSync(req.body.password, user.password)) %7B%0A          res.send(user);%0A        %7D else %7B%0A          res.send(%7B error: 'Incorrect password' %7D);%0A        %7D%0A      %7D else %7B%0A        res.send(%7B error: 'No account found with that email' %7D);%0A      %7D%0A    %7D);
 %0A  %7D
@@ -517,16 +517,24 @@
 ogOut: (
+req, res
 ) =%3E %7B%0A 

Implement logIn function in authController