From c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 29 Apr 2023 15:39:25 +0200 Subject: Fixed invalid username handling --- database/users.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'database') diff --git a/database/users.js b/database/users.js index cc50bdc..353b54a 100644 --- a/database/users.js +++ b/database/users.js @@ -34,6 +34,9 @@ export async function login(username, password) { console.log(err); return null; } + if (user === undefined) { + return null; + } const result = await bcrypt.compare(password, user.hash); if (result === true) { return { -- cgit v1.2.3