mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
check user auth
This commit is contained in:
+2
-2
@@ -111,8 +111,8 @@ def status_code(code):
|
||||
return r
|
||||
|
||||
|
||||
def check_basic_authorization():
|
||||
def check_basic_auth(user, passwd):
|
||||
"""Checks user authentication using HTTP Basic Auth."""
|
||||
|
||||
auth = request.authorization
|
||||
return auth and auth.username == "httpbin" and auth.password == "secret"
|
||||
return auth and auth.username == user and auth.password == passwd
|
||||
|
||||
Reference in New Issue
Block a user