title: "TypeError: Cannot read property 'status' of undefined" node.js
body: <p>im trying to make a function that return a token using nodejs express.js sequelize
  and i got this error 
  "TypeError: Cannot read property 'status' of undefined"</p>
  
  <pre><code>exports.login = (data)=&gt;{
     return user.findOne({
          where : {userName: data.userName}
      }).then(userFound =&gt; {
          if (userFound){
  
              bcrypt.compare(data.password,userFound.password,(errBcrypt,resBcrypt)=&gt;{
                  if(resBcrypt) {
                      return {
                          status : 201,
                          token : jwt.sign({id: user.id},secretCode,{expiresIn:'1h'})
                      };
                  }else {
                      return {
                          status : 403,
                          errBcrypt : 'password invalid!'
                      };
                  }
              })
  
          }else{
              return {
                  status : 403,
                  error : 'user not exist!'
              };
          }
  
      })
      .catch((err) =&gt;{
          return {
              status : 403,
              error : err
          };
      });
  
  }
  </code></pre>