Spaces:
Runtime error
Runtime error
Update google_function.py
Browse files139 unmodified lines14014114214314414514614714814915010 unmodified lines161162163164165166167139 unmodified linesreturn st_javascript(f"localStorage.setItem('{key}', '{value}');")def connetti_google():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')token = local_storage_get("token")print('------------1------------------')print(token)10 unmodified linesauth_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";')else:print('------------4------------------')st.write("")139 unmodified lines14014114214314414514614714814915015110 unmodified lines162163164165166167168169139 unmodified linesreturn 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=redirect)token = local_storage_get("token")print('------------1------------------')print(token)10 unmodified linesauth_code = st.query_params.get("code")if auth_code:local_storage_set("token", auth_code)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