Skip to content

Commit

Permalink
Get oauth callback uri from env
Browse files Browse the repository at this point in the history
  • Loading branch information
Vidminas committed Feb 1, 2024
1 parent 8181393 commit 6b3c2e7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions chat_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
from langchain.schema import messages_to_dict
from chat_app.solid_message_history import SolidChatMessageHistory


OAUTH_CALLBACK_URI = "http://localhost:8501/callback"
hostname = os.environ.get("WEBSITE_HOSTNAME")
if hostname is not None:
OAUTH_CALLBACK_URI = f"https://{hostname}/callback"
else:
OAUTH_CALLBACK_URI = "http://localhost:8501/callback"


def setup_login_sidebar():
Expand Down Expand Up @@ -104,12 +107,6 @@ def main():
st.sidebar.title("Options")
setup_login_sidebar()

st.text("WEBSITE_SITE_NAME", help=os.environ.get("WEBSITE_SITE_NAME"))
st.text("WEBSITE_HOSTNAME", help=os.environ.get("WEBSITE_HOSTNAME"))
st.text("SERVER_PORT", help=os.environ.get("SERVER_PORT"))
st.text("PORT", help=os.environ.get("PORT"))
st.text("WEBSITES_PORT", help=os.environ.get("WEBSITES_PORT"))

if "solid_token" in st.session_state:
if "msg_history" not in st.session_state:
st.session_state["msg_history"] = SolidChatMessageHistory(
Expand Down

0 comments on commit 6b3c2e7

Please sign in to comment.