elfsong commited on
Commit
a0f09fb
β€’
1 Parent(s): 39f2ddf
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,10 +5,10 @@ from google.oauth2 import service_account
5
 
6
  def auth():
7
  with open("/tmp/token.json", "w") as token_f:
8
- token_f.write("Hello")
9
-
10
- with open("/tmp/token.json", "r") as token_f:
11
- credentials = token_f.read()
12
 
13
  return credentials
14
 
@@ -30,7 +30,7 @@ st.title("Lucky Reactor")
30
 
31
  credentials = auth()
32
  status = True
33
- st.markdown("credentials: ", credentials)
34
 
35
  st.image("cover.jpg", caption="Reactor is currently " + "running πŸš€" if status else "sleeping 😴" + ".")
36
 
 
5
 
6
  def auth():
7
  with open("/tmp/token.json", "w") as token_f:
8
+ google_key = os.getenv["GOOGLE_KEY"]
9
+ token_f.write(google_key)
10
+
11
+ credentials = service_account.Credentials.from_service_account_file('/tmp/token.json')
12
 
13
  return credentials
14
 
 
30
 
31
  credentials = auth()
32
  status = True
33
+ st.markdown("credentials: " + credentials)
34
 
35
  st.image("cover.jpg", caption="Reactor is currently " + "running πŸš€" if status else "sleeping 😴" + ".")
36