Exemplo n.º 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
Exemplo n.º 2
0
Arquivo: app.py Projeto: 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