chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Unable to utilize OAuth authentication with custom react frontend due to internal URL

Open mikkelgthang opened this issue 1 year ago • 5 comments

When using @cl.oauth_callback as described in the docs, CHAINLIT_URL can be set to define the backend's URL - which works as expected. However, the RedirectResponse defined in oauth_callback simply calls url=f"/login?{params}", which means that the callback url wrongly uses the CHAINLIT_URL, and not the frontend's URL that made the request. I can see that it includes a FIXME comment, but in case other matters are more pressing, is there potentially any way to overwrite the implementation? I tried to define the same endpoint in my app.py file, but it still uses the internal function. Currently, I have no way of returning the token to my custom frontend url detached from CHAINLIT_URL. 😃

Thank you in advance 👏

mikkelgthang avatar Apr 15 '24 14:04 mikkelgthang