Spaces:
Sleeping
Sleeping
Update google_function.py
Browse files- google_function.py +4 -0
google_function.py
CHANGED
|
@@ -13,6 +13,7 @@ import webbrowser
|
|
| 13 |
import datetime
|
| 14 |
from streamlit_javascript import st_javascript
|
| 15 |
import streamlit as st
|
|
|
|
| 16 |
|
| 17 |
SCOPES = ["https://www.googleapis.com/auth/gmail.compose",
|
| 18 |
"https://www.googleapis.com/auth/gmail.modify",
|
|
@@ -162,6 +163,9 @@ def connetti_google():
|
|
| 162 |
auth_code = st.query_params.get("code")
|
| 163 |
if auth_code:
|
| 164 |
local_storage_set("token", auth_code)
|
|
|
|
|
|
|
|
|
|
| 165 |
nav_script = """<meta http-equiv="refresh" content="0; url='%s'">""" % (redirect)
|
| 166 |
st.write(nav_script, unsafe_allow_html=True)
|
| 167 |
else:
|
|
|
|
| 13 |
import datetime
|
| 14 |
from streamlit_javascript import st_javascript
|
| 15 |
import streamlit as st
|
| 16 |
+
import time
|
| 17 |
|
| 18 |
SCOPES = ["https://www.googleapis.com/auth/gmail.compose",
|
| 19 |
"https://www.googleapis.com/auth/gmail.modify",
|
|
|
|
| 163 |
auth_code = st.query_params.get("code")
|
| 164 |
if auth_code:
|
| 165 |
local_storage_set("token", auth_code)
|
| 166 |
+
time.sleep(2)
|
| 167 |
+
print('**************************************************************')
|
| 168 |
+
print(auth_code)
|
| 169 |
nav_script = """<meta http-equiv="refresh" content="0; url='%s'">""" % (redirect)
|
| 170 |
st.write(nav_script, unsafe_allow_html=True)
|
| 171 |
else:
|