blazingbunny commited on
Commit
01af3f9
·
verified ·
1 Parent(s): 388ad56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
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 os
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
- CLIENT_SECRET_FILE,
17
- scopes=SCOPES,
18
- redirect_uri=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()