code: def auth_user(self, username, password):
          
          password_hash = hashlib.sha512(password.encode("utf-8")).hexdigest()
  
          user = self._database.users.find_one(
              {"username": username, "password": password_hash, "activate": {"$exists": False}})
  
          return user if user is not None and self.connect_user(username, user["realname"], user["email"], user["language"]) else None
docs: Authenticate the user in database
          :param username: Username/Login
          :param password: User password
          :return: Returns a dict represrnting the user