Spaces:
Running
Running
Jon Solow
commited on
Commit
•
0ca1e0b
1
Parent(s):
6054b1d
Set login component based on environment variable defaulted false
Browse files- src/login_component.py +4 -0
src/login_component.py
CHANGED
@@ -17,11 +17,15 @@ CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
|
|
17 |
REDIRECT_URI = os.environ.get("REDIRECT_URI")
|
18 |
SCOPE = os.environ.get("SCOPE")
|
19 |
|
|
|
|
|
20 |
# Create OAuth2Component instance
|
21 |
oauth2 = OAuth2Component(CLIENT_ID, CLIENT_SECRET, AUTHORIZE_URL, TOKEN_URL, REFRESH_TOKEN_URL, REVOKE_TOKEN_URL)
|
22 |
|
23 |
|
24 |
def get_authorization_button():
|
|
|
|
|
25 |
# Check if token exists in session state
|
26 |
if "token" not in st.session_state:
|
27 |
# If not, show authorize button
|
|
|
17 |
REDIRECT_URI = os.environ.get("REDIRECT_URI")
|
18 |
SCOPE = os.environ.get("SCOPE")
|
19 |
|
20 |
+
ENABLE_LOGIN = os.environ.get("ENABLE_LOGIN", False)
|
21 |
+
|
22 |
# Create OAuth2Component instance
|
23 |
oauth2 = OAuth2Component(CLIENT_ID, CLIENT_SECRET, AUTHORIZE_URL, TOKEN_URL, REFRESH_TOKEN_URL, REVOKE_TOKEN_URL)
|
24 |
|
25 |
|
26 |
def get_authorization_button():
|
27 |
+
if not ENABLE_LOGIN:
|
28 |
+
return
|
29 |
# Check if token exists in session state
|
30 |
if "token" not in st.session_state:
|
31 |
# If not, show authorize button
|