Demosthene-OR commited on
Commit
c9aba22
1 Parent(s): fc7b842

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -93,10 +93,10 @@ def authenticate(authorization: str = Header(None)):
93
  try:
94
  scheme, credentials = authorization.split()
95
  if scheme != 'Basic':
96
- raise HTTPException(status_code=401, detail="Utilisateur non authorisé")
97
  username, password = credentials.split(":")
98
  if username not in users_credentials or users_credentials[username] != password:
99
- raise HTTPException(status_code=401, detail="Utilisateur non authorisé")
100
  except Exception as e:
101
  raise HTTPException(status_code=401, detail="Utilisateur non authorisé")
102
  return username, password
 
93
  try:
94
  scheme, credentials = authorization.split()
95
  if scheme != 'Basic':
96
+ raise HTTPException(status_code=401, detail="Utilisateur non authorisé "+scheme)
97
  username, password = credentials.split(":")
98
  if username not in users_credentials or users_credentials[username] != password:
99
+ raise HTTPException(status_code=401, detail="Utilisateur non authorisé "+username+":"+password)
100
  except Exception as e:
101
  raise HTTPException(status_code=401, detail="Utilisateur non authorisé")
102
  return username, password