From 4a0f7c093c86a2942a455bf84646952370097dc1 Mon Sep 17 00:00:00 2001 From: xfarrow Date: Mon, 2 Oct 2023 12:21:13 +0200 Subject: [PATCH] Update api.js --- backend/api.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/api.js b/backend/api.js index e66c2bd..0233928 100644 --- a/backend/api.js +++ b/backend/api.js @@ -43,6 +43,8 @@ app.post('/api/register', (req, res) => { return res.status(400).json("Invalid request"); } + // The callback denoted by the arrow function is executed asynchronously + // from the rest of the code outside of the hash() function bcrypt.hash(userData.password, 10, (err, hashedPassword) => { if (err) {