|
|
@ -21,15 +21,13 @@ def authenticate(): |
|
|
|
"""Sends a 401 response that enables basic auth""" |
|
|
|
return Response( |
|
|
|
'Could not verify your access level for that URL.\n' |
|
|
|
'You have to login with proper credentials\n', 401, |
|
|
|
{'WWW-Authenticate': 'Basic realm="Login Required"'}) |
|
|
|
'You have to login with proper credentials\n', 401) |
|
|
|
|
|
|
|
def admin_required(): |
|
|
|
"""Sends a 401 response that enables basic auth""" |
|
|
|
return Response( |
|
|
|
'Could not verify your access level for that URL.\n' |
|
|
|
'You have to login with admin rights\n', 401, |
|
|
|
{'WWW-Authenticate': 'Basic realm="Admin login Required"'}) |
|
|
|
'You have to login with admin rights\n', 401) |
|
|
|
|
|
|
|
def requires_auth(f): |
|
|
|
@wraps(f) |
|
|
|