Update app.py
Browse files
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
|
| 18 |
-
|
|
|
|
| 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
|