    def _get_token_url(self, handler):
        """Get the token from the URL

        Always run for websockets,
        otherwise run only if self.allow_token_in_url
        """
        fetch_mode = handler.request.headers.get("Sec-Fetch-Mode", "unspecified")
        if self.allow_token_in_url or fetch_mode == "websocket":
            return handler.get_argument("token", "")
        return ""
Get the token from the URL

Always run for websockets,
otherwise run only if self.allow_token_in_url
jupyterhub/services/auth.py