From 6157c68c30483c4545e699c47a37c111bed024ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Fri, 23 Apr 2021 18:54:05 +0200 Subject: [PATCH] fix login --- server/authentication.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/authentication.py b/server/authentication.py index 885c27b..4006bf0 100644 --- a/server/authentication.py +++ b/server/authentication.py @@ -47,11 +47,14 @@ class Authetication: try: b64pwd = b64encode(SHA256.new(password.encode('utf-8')).digest()) bcrypt_check(b64pwd, user['password'].encode('utf-8')) + auth_logger.debug("User logged in: " + username) + return user['homeDir'] except ValueError: auth_logger.debug("User NOT logged in: " + username) return '' - auth_logger.debug("User logged in: " + username) - return user['homeDir'] + else: + auth_logger.error("User not found") + return '' def checkUserExists(self, username: str) -> bool: with open(self.CONFIG_FILE_LOCATION) as json_file: