diff --git a/contexts/user_login.py b/contexts/user_login.py index 0765af7..86133b0 100644 --- a/contexts/user_login.py +++ b/contexts/user_login.py @@ -3,6 +3,7 @@ from contexts.menu import Menu from utils.user_db import UserDB from utils.config import config +from utils.log import logger ''' Authenticates a user to the BBS. When a user successfully authenticates, the context will switch to whatever the second menu object is in config.toml. @@ -53,6 +54,7 @@ def receive_handler(self, packet: dict) -> str: elif self.state == STATE_PASSWORD: # Try to authenticate if self.user_db.user_authenticate(self.username, text): + logger.info(f"User {self.username} logged in.") self.message.body = "Login successful!" self.session.send_message(self.message) self.session.set_authenticated(self.username) @@ -64,6 +66,7 @@ def receive_handler(self, packet: dict) -> str: # User failed to authenticate else: + logger.info(f"User {self.username} failed to log in.") self.message.body = "Login failure!" self.session.send_message(self.message) self.session.revert_context() diff --git a/interfaces/comm_interface.py b/interfaces/comm_interface.py index 86c09f1..ea2430c 100644 --- a/interfaces/comm_interface.py +++ b/interfaces/comm_interface.py @@ -40,7 +40,7 @@ def on_receive(self, packet: dict, interface) -> None: # Does user have a session currently? if session_db.check_session(user_id): - logger.info("User has session") + logger.debug("User has session") # If the interface is None, it's because the connection is not from the Mesh but from TCP or something else if interface != None: