Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,8 +24,8 @@ SPACE_HOST = os.getenv("SPACE_HOST")
|
|
24 |
redirect_uri = f"https://{SPACE_HOST}/login/callback"
|
25 |
|
26 |
# Initializing the OAuth client/session with the retrieved environment variables
|
27 |
-
oauth_client = OAuth2Session(client_id=
|
28 |
-
client_secret=
|
29 |
scope=OAUTH_SCOPES,
|
30 |
redirect_uri=redirect_uri)
|
31 |
|
@@ -62,18 +62,6 @@ from typing import Dict, Optional
|
|
62 |
import chainlit as cl
|
63 |
|
64 |
|
65 |
-
# Retrieving environment variables
|
66 |
-
OAUTH_CLIENT_ID = os.getenv("OAUTH_CLIENT_ID")
|
67 |
-
OAUTH_CLIENT_SECRET = os.getenv("OAUTH_CLIENT_SECRET")
|
68 |
-
OAUTH_SCOPES = os.getenv("OAUTH_SCOPES").split(',') # Assuming OAUTH_SCOPES is a comma-separated list
|
69 |
-
OPENID_PROVIDER_URL = os.getenv("OPENID_PROVIDER_URL")
|
70 |
-
SPACE_HOST = os.getenv("SPACE_HOST")
|
71 |
-
|
72 |
-
# Constructing the redirect URL using the SPACE_HOST variable
|
73 |
-
redirect_uri = f"https://{SPACE_HOST}/login/callback"
|
74 |
-
|
75 |
-
print(OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_SCOPES, OPENID_PROVIDER_URL, SPACE_HOST, redirect_uri)
|
76 |
-
|
77 |
@cl.on_chat_start
|
78 |
async def on_chat_start():
|
79 |
app_user = cl.user_session.get("user")
|
|
|
24 |
redirect_uri = f"https://{SPACE_HOST}/login/callback"
|
25 |
|
26 |
# Initializing the OAuth client/session with the retrieved environment variables
|
27 |
+
oauth_client = OAuth2Session(client_id="a70d7765-e2bb-45db-b2b2-2deb0963df13",
|
28 |
+
client_secret="e5801934-7016-446d-839f-d169a0859f7b", # Include client_secret if needed for the OAuth2Session setup
|
29 |
scope=OAUTH_SCOPES,
|
30 |
redirect_uri=redirect_uri)
|
31 |
|
|
|
62 |
import chainlit as cl
|
63 |
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
@cl.on_chat_start
|
66 |
async def on_chat_start():
|
67 |
app_user = cl.user_session.get("user")
|