Spaces:
Sleeping
Sleeping
Update AuthVerification.py
Browse files- AuthVerification.py +8 -9
AuthVerification.py
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
|
4 |
-
def
|
5 |
-
|
6 |
-
return
|
7 |
|
8 |
-
def auth_verification(
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
return can_enter_the_space
|
14 |
|
15 |
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
|
4 |
+
def get_accepted_username_passwords():
|
5 |
+
username__passwords = [os.environ.get(f'USER_{i}', None) for i in range(900) if os.environ.get(f'USER_{i}', False)]
|
6 |
+
return username__passwords
|
7 |
|
8 |
+
def auth_verification(username, password):
|
9 |
+
username__password = f'{username}__{password}'
|
10 |
+
username__passwords_accepted = get_accepted_username_passwords()
|
11 |
+
allowed = username__password in username__passwords_accepted
|
12 |
+
return allowed
|
|
|
13 |
|
14 |
|