def auth_by_password(): params = json.loads(request.data.decode("utf-8")) print(params) if auth.check_password(params["password"], request.remote_addr): cookie = auth.generate_cookie(request) return cookie else: return make_response("auth failed"), 400
def auth_by_password(): params = json.loads(request.data.decode('utf-8')) print(params) if auth.check_password(params['password']): cookie = auth.generate_cookie(request) return cookie else: return make_response("auth failed"), 400