FACG2 / GSG_Orders_Manager

week 6 database project for GSG orders management
0 stars 0 forks source link

checkMembersCredits behaviour different to expected #22

Open eliasmalik opened 7 years ago

eliasmalik commented 7 years ago

The checkMembersCredits function has the opposite behaviour to what is assumed by its user in the login handler.

Specifically, if there is an error, checkMemberCredits will execute the callback with a single truthy argument (the Error object). In the login handler, the callback we pass in only assumes a single argument, which it checks for truthiness. If the argument is truthy, it assumes the email exists. But actually, the argument will be truthy if there has been an error (because all objects are truthy). This is not the behaviour that is expected.

This is related to #20 because it can be addressed by using error-first callbacks

Sohadwd commented 7 years ago

This is the first version and we already solved it but not merged