briangormanly / outfox

4 stars 1 forks source link

Using the wrong password causes the system to crash #61

Open briangormanly opened 3 years ago

briangormanly commented 3 years ago

the user object is null when this like runs and is not checked const isMatch = bcrypt.compareSync(password, user.hashpw);

Executing (default): SELECT 1+1 AS result [1] Connection has been established successfully [1] ::1 - - [11/Dec/2020:21:33:47 +0000] "OPTIONS /login HTTP/1.1" 204 0 [1] /Users/brian/projects/opensource/outfox/server/dist/middleware/passportConfig.js:29 [1] const isMatch = bcrypt_1.default.compareSync(password, user.hashpw); [1] ^ [1] [1] TypeError: Cannot read property 'hashpw' of null [1] at /Users/brian/projects/opensource/outfox/server/dist/middleware/passportConfig.js:29:65 [1] at Generator.next () [1] at fulfilled (/Users/brian/projects/opensource/outfox/server/dist/middleware/passportConfig.js:5:58) [1] at processTicksAndRejections (node:internal/process/task_queues:93:5) [1] npm ERR! code 1 [1] npm ERR! path /Users/brian/projects/opensource/outfox/server [1] npm ERR! command failed [1] npm ERR! command sh -c node .

briangormanly commented 3 years ago

fix in testing