Exemplo n.º 1
0
def login():
    email = request.form['email']
    password = request.form['password']

    id = user.auth(email, password)

    if id == -1:
        abort(403)

    session["id"] = id
    session["email"] = email

    return jsonify(session_id=session.sid, success=True)
Exemplo n.º 2
0
def loginPost():
    email = request.form["email"]
    password = request.form["password"]

    id = user.auth(email, password)

    if id == -1:
        return redirect(url_for("loginGet"))

    session["id"] = id
    session["email"] = email

    return redirect(url_for("index"))