def _align_url_to_allow_http_redirect(url: str) -> str:
        """This method is used to align the URL to the HTTP/HTTPS scheme"""

        scheme = "http" if settings.oauth.allow_http_redirect else "https"
        return re.sub(r"^https?", scheme, url)
This method is used to align the URL to the HTTP/HTTPS scheme
argilla-server/src/argilla_server/security/authentication/oauth2/provider.py