Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,15 @@
|
|
1 |
import streamlit as st
|
2 |
from google.oauth2 import service_account
|
3 |
-
from google.auth.transport.requests import Request
|
4 |
from google_auth_oauthlib.flow import Flow
|
5 |
-
import
|
6 |
-
|
7 |
-
# Define your Google OAuth credentials
|
8 |
-
CLIENT_SECRET_FILE = 'client_secret.json'
|
9 |
-
SCOPES = ['https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email']
|
10 |
-
REDIRECT_URI = 'https://huggingface.co/spaces/blazingbunny/galerts/'
|
11 |
-
PORT = 8081
|
12 |
|
13 |
# Function to create Google OAuth Flow object
|
14 |
def create_flow():
|
|
|
15 |
return Flow.from_client_secrets_file(
|
16 |
-
|
17 |
-
scopes=
|
18 |
-
redirect_uri=
|
19 |
)
|
20 |
|
21 |
# Function to generate Google Sign-In URL
|
@@ -37,4 +31,4 @@ def main():
|
|
37 |
authenticate_user()
|
38 |
|
39 |
if __name__ == "__main__":
|
40 |
-
main()
|
|
|
1 |
import streamlit as st
|
2 |
from google.oauth2 import service_account
|
|
|
3 |
from google_auth_oauthlib.flow import Flow
|
4 |
+
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# Function to create Google OAuth Flow object
|
7 |
def create_flow():
|
8 |
+
client_secret = st.secrets["client_secret"]
|
9 |
return Flow.from_client_secrets_file(
|
10 |
+
client_secret,
|
11 |
+
scopes=['https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email'],
|
12 |
+
redirect_uri='https://huggingface.co/spaces/blazingbunny/galerts:8501'
|
13 |
)
|
14 |
|
15 |
# Function to generate Google Sign-In URL
|
|
|
31 |
authenticate_user()
|
32 |
|
33 |
if __name__ == "__main__":
|
34 |
+
main()
|