Exemple #1
0
def register():
    name = request.form["name"]
    password = request.form["password"]
    slip = gen_slip(name, password)
    db.session.flush()
    make_session(slip)
    db.session.commit()
    return redirect(url_for("slip.landing"))
Exemple #2
0
def slip_login():
    form_name = request.form["name"]
    password = request.form["password"]
    slip = db.session.query(Slip).filter(Slip.name == form_name).one_or_none()
    if slip:
        if check_password_hash(slip.pass_hash, password):
            make_session(slip)
        else:
            flash("Incorrect username or password!")
    else:
        flash("Incorrect username or password!")
    return redirect(url_for("slip_landing"))
Exemple #3
0
def slip_request():
    name = request.form["name"]
    password = request.form["password"]
    slip = gen_slip(name, password)
    make_session(slip)
    return redirect(url_for("slip_landing"))