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)
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"))