Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -31,10 +31,7 @@ import json
|
|
| 31 |
|
| 32 |
@cl.password_auth_callback
|
| 33 |
def auth_callback(username: str, password: str):
|
| 34 |
-
|
| 35 |
-
#resultPwdAdmin = bcrypt.checkpw(password.encode('utf-8'), bcrypt.hashpw(os.environ['CHAINLIT_AUTH_PASSWD'].encode('utf-8'), bcrypt.gensalt()))
|
| 36 |
-
arrayAuth = "[" + os.environ['CHAINLIT_AUTH_LOGIN'] + "]"
|
| 37 |
-
auth = json.loads(arrayAuth)
|
| 38 |
ident = next(d['ident'] for d in auth if d['ident'] == username)
|
| 39 |
pwd = next(d['pwd'] for d in auth if d['ident'] == username)
|
| 40 |
resultLogAdmin = bcrypt.checkpw(username.encode('utf-8'), bcrypt.hashpw(ident.encode('utf-8'), bcrypt.gensalt()))
|
|
|
|
| 31 |
|
| 32 |
@cl.password_auth_callback
|
| 33 |
def auth_callback(username: str, password: str):
|
| 34 |
+
auth = json.loads(os.environ['CHAINLIT_AUTH_LOGIN'])
|
|
|
|
|
|
|
|
|
|
| 35 |
ident = next(d['ident'] for d in auth if d['ident'] == username)
|
| 36 |
pwd = next(d['pwd'] for d in auth if d['ident'] == username)
|
| 37 |
resultLogAdmin = bcrypt.checkpw(username.encode('utf-8'), bcrypt.hashpw(ident.encode('utf-8'), bcrypt.gensalt()))
|