Demosthene-OR
commited on
Commit
·
e5ac538
1
Parent(s):
4a4b969
Update main.py
Browse files
main.py
CHANGED
@@ -92,8 +92,8 @@ def authenticate(authorization: str = Header(None)):
|
|
92 |
print("scheme, credentials ",authorization)
|
93 |
try:
|
94 |
scheme, credentials = authorization.split()
|
95 |
-
print("scheme="+scheme
|
96 |
-
if scheme
|
97 |
raise HTTPException(status_code=401, detail="Utilisateur non authorisé "+scheme)
|
98 |
username, password = credentials.split(":")
|
99 |
if username not in users_credentials or users_credentials[username] != password:
|
|
|
92 |
print("scheme, credentials ",authorization)
|
93 |
try:
|
94 |
scheme, credentials = authorization.split()
|
95 |
+
print("scheme="+scheme+" credentials="+credentials)
|
96 |
+
if scheme != 'Basic':
|
97 |
raise HTTPException(status_code=401, detail="Utilisateur non authorisé "+scheme)
|
98 |
username, password = credentials.split(":")
|
99 |
if username not in users_credentials or users_credentials[username] != password:
|