Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,13 +54,13 @@ def main():
|
|
| 54 |
# π Authentication
|
| 55 |
if 'access_token' not in st.session_state:
|
| 56 |
# π΅οΈββοΈ Check for authorization code in query parameters
|
| 57 |
-
query_params = st.
|
| 58 |
if 'code' in query_params:
|
| 59 |
code = query_params['code'][0]
|
| 60 |
st.write('π Acquiring access token...')
|
| 61 |
access_token = get_access_token(code)
|
| 62 |
st.session_state['access_token'] = access_token
|
| 63 |
-
st.
|
| 64 |
else:
|
| 65 |
# π’ Prompt user to log in
|
| 66 |
client_instance = get_msal_app()
|
|
|
|
| 54 |
# π Authentication
|
| 55 |
if 'access_token' not in st.session_state:
|
| 56 |
# π΅οΈββοΈ Check for authorization code in query parameters
|
| 57 |
+
query_params = st.get_query_params()
|
| 58 |
if 'code' in query_params:
|
| 59 |
code = query_params['code'][0]
|
| 60 |
st.write('π Acquiring access token...')
|
| 61 |
access_token = get_access_token(code)
|
| 62 |
st.session_state['access_token'] = access_token
|
| 63 |
+
st.rerun() # Reload the app to clear the code from URL
|
| 64 |
else:
|
| 65 |
# π’ Prompt user to log in
|
| 66 |
client_instance = get_msal_app()
|