You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When Chainlit application is configured behind proxy with custom CHAINLIT_URL and CHAINLIT_ROOT_PATH env environment variables redirect_url parameter for the keycloak authentication has double the root path
See network calls in Dev tools - redirect_url parameter for keycloak will double root path https://keycloakbase.com/realms/keycloak_realm/protocol/openid-connect/auth?client_id=keycloal_client_id&redirect_uri=https%3A%2F%2Fmydomain.com%2Fchainlit-ui%2Fchainlit-ui%2Fauth%2Foauth%2Fkeycloak%2Fcallback
Expected behavior
CHAINLIT_ROOT_PATH should not be added to the redirect url
Desktop (please complete the following information):
Browser any
The text was updated successfully, but these errors were encountered:
For now we forked the project and modified this method
defget_user_facing_url(url: URL):
""" Return the user facing URL for a given URL. Handles deployment with proxies (like cloud run). """chainlit_url=os.environ.get("CHAINLIT_URL")
# No config, we keep the URL as isifnotchainlit_url:
url=url.replace(query="", fragment="")
returnurl.__str__()
config_url=URL(chainlit_url).replace(
query="",
fragment="",
)
# Remove trailing slash from config URLifconfig_url.path.endswith("/"):
config_url=config_url.replace(path=config_url.path[:-1])
config_url_path=str(config_url)
url_path=url.pathchainlit_root=os.environ.get("CHAINLIT_ROOT_PATH")
ifchainlit_rootandurl_path.startswith(chainlit_root):
url_path=url_path[len(chainlit_root):]
returnconfig_url_path+url_path
Describe the bug
When Chainlit application is configured behind proxy with custom CHAINLIT_URL and CHAINLIT_ROOT_PATH env environment variables redirect_url parameter for the keycloak authentication has double the root path
To Reproduce
Steps to reproduce the behavior:
https://keycloakbase.com/realms/keycloak_realm/protocol/openid-connect/auth?client_id=keycloal_client_id&redirect_uri=https%3A%2F%2Fmydomain.com%2Fchainlit-ui%2Fchainlit-ui%2Fauth%2Foauth%2Fkeycloak%2Fcallback
Expected behavior
CHAINLIT_ROOT_PATH should not be added to the redirect url
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: