Example #1
0
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
Example #2
0
File: app.py Project: tsw520/JavPy
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