    async def add_user(self, user):
        """Hook called whenever a new user is added

        If self.create_system_users, the user will attempt to be created if it doesn't exist.
        """
        user_exists = await maybe_future(self.system_user_exists(user))
        if not user_exists:
            if self.create_system_users:
                await maybe_future(self.add_system_user(user))
            else:
                raise KeyError(
                    f"User {user.name} does not exist on the system."
                    " Set LocalAuthenticator.create_system_users=True"
                    " to automatically create system users from jupyterhub users."
                )

        await maybe_future(super().add_user(user))
Hook called whenever a new user is added

If self.create_system_users, the user will attempt to be created if it doesn't exist.
jupyterhub/auth.py