Spaces:
Sleeping
Sleeping
Update google_function.py
Browse files139 unmodified lines14014114214314414514614714714814915015110 unmodified lines162163164164165166167168169139 unmodified lines return st_javascript(f"localStorage.setItem('{key}', '{value}');")
def connetti_google(): redirect = 'https://matteoscript-streamlitchat-new.hf.space' load_dotenv() json_variable_str = os.getenv("JSON_GOOGLE") with open("./credentials.json", "w") as f: f.write(json_variable_str) flow = InstalledAppFlow.from_client_secrets_file("./credentials.json", SCOPES, redirect_uri='https://matteoscript-streamlitchat-new.hf.space') flow = InstalledAppFlow.from_client_secrets_file("./credentials.json", SCOPES, redirect_uri=redirect) token = local_storage_get("token") print('------------1------------------') print(token)10 unmodified lines auth_code = st.query_params.get("code") if auth_code: local_storage_set("token", auth_code) st_javascript('window.location.href = "https://matteoscript-streamlitchat-new.hf.space";') nav_script = """<meta http-equiv="refresh" content="0; url='%s'">""" % (redirect) st.write(nav_script, unsafe_allow_html=True) else: print('------------4------------------') st.write("")google_function.py+4-2