1@app.route("/login", methods=["POST", "GET"])
2def login():
3 if request.method == "POST":
4 user = request.form["name"]
5 return redirect(url_for("success", name=user))
6 else:
7 user = request.args.get("name")
8 return redirect(url_for("success", name=user))