satpalsr commited on
Commit
da1d74c
·
1 Parent(s): 1b3c40f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -12,10 +12,11 @@ def echo(name, request: gr.Request):
12
  print("IP address:", request.client.host)
13
  return str(request.headers), str(request.client.host)
14
 
15
- def verify_auth(username, password):
16
  global auth_value
17
- if auth_value == True:
18
- return True
 
19
  elif username == "admin" and password == "admin":
20
  auth_value = True
21
  return True
 
12
  print("IP address:", request.client.host)
13
  return str(request.headers), str(request.client.host)
14
 
15
+ def verify_auth(username, password, request: gr.Request):
16
  global auth_value
17
+ if dict(request.headers)['origin'] in os.environ["ORIGIN"]:
18
+ auth_value = True
19
+ return True
20
  elif username == "admin" and password == "admin":
21
  auth_value = True
22
  return True