Changed authentication check
This commit is contained in:
@@ -5,7 +5,12 @@ import json, time
|
||||
app = Flask(__name__)
|
||||
|
||||
def check_auth(username, password):
|
||||
return username == 'davide' and password == 'pwd'
|
||||
admin_list = []
|
||||
with open('admin.json', 'r') as admin:
|
||||
admin_list = json.load(admin)
|
||||
for user in admin_list:
|
||||
if username == user['username']:
|
||||
return password == user['password']
|
||||
|
||||
def authenticate():
|
||||
return Response('Could not verify access level. Please retry', 401, {'WWW-Authenticate' : 'Basic realm="Login Required"'})
|
||||
|
||||
Reference in New Issue
Block a user