Spaces:
Running
Running
Update google_function.py
Browse files- google_function.py +0 -8
google_function.py
CHANGED
|
@@ -151,15 +151,7 @@ def connetti_google():
|
|
| 151 |
flow.fetch_token(code=auth_code)
|
| 152 |
creds = flow.credentials
|
| 153 |
st.write("Login Done")
|
| 154 |
-
user_info_service = build(
|
| 155 |
-
serviceName="oauth2",
|
| 156 |
-
version="v2",
|
| 157 |
-
credentials=creds,
|
| 158 |
)
|
| 159 |
-
user_info = user_info_service.userinfo().get().execute()
|
| 160 |
-
assert user_info.get("email"), "Email not found in infos"
|
| 161 |
-
st.session_state["google_auth_code"] = auth_code
|
| 162 |
-
st.session_state["user_info"] = user_info
|
| 163 |
else:
|
| 164 |
authorization_url, state = flow.authorization_url(include_granted_scopes="true",)
|
| 165 |
print(authorization_url)
|
|
|
|
| 151 |
flow.fetch_token(code=auth_code)
|
| 152 |
creds = flow.credentials
|
| 153 |
st.write("Login Done")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
else:
|
| 156 |
authorization_url, state = flow.authorization_url(include_granted_scopes="true",)
|
| 157 |
print(authorization_url)
|