    def page_config_hook(self, handler, page_config):
        """JupyterLab page config hook

        Adds JupyterHub info to page config.

        Places the JupyterHub API token in PageConfig.token.

        Only has effect on jupyterlab_server >=2.9
        """
        page_config["token"] = self.hub_auth.get_token(handler) or ""
        page_config["hubServerUser"] = os.environ.get("JUPYTERHUB_USER", "")
        return page_config
JupyterLab page config hook

Adds JupyterHub info to page config.

Places the JupyterHub API token in PageConfig.token.

Only has effect on jupyterlab_server >=2.9
jupyterhub/singleuser/mixins.py