poemsforaphrodite commited on
Commit
28c5649
1 Parent(s): fd6bb51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -344,9 +344,17 @@ def main():
344
  if 'auth_flow' not in st.session_state or 'auth_url' not in st.session_state:
345
  st.session_state.auth_flow, st.session_state.auth_url = google_auth(client_config)
346
 
347
- query_params = st.experimental_get_query_params()
 
 
 
348
  print(query_params)
349
- auth_code = query_params.get("code", [None])[0]
 
 
 
 
 
350
 
351
  if auth_code and 'credentials' not in st.session_state:
352
  st.session_state.auth_flow.fetch_token(code=auth_code)
 
344
  if 'auth_flow' not in st.session_state or 'auth_url' not in st.session_state:
345
  st.session_state.auth_flow, st.session_state.auth_url = google_auth(client_config)
346
 
347
+ # Directly access query parameters using st.query_params
348
+ query_params = st.query_params
349
+
350
+ # Print the query parameters
351
  print(query_params)
352
+
353
+ # Retrieve the 'code' parameter
354
+ auth_code = query_params.get("code", None)
355
+
356
+ # Since st.query_params returns a string (not a list), no need for [0]
357
+
358
 
359
  if auth_code and 'credentials' not in st.session_state:
360
  st.session_state.auth_flow.fetch_token(code=auth_code)