devel..
This commit is contained in:
parent
a9d0a707f6
commit
3e84c65282
11
app.py
11
app.py
@ -14,11 +14,14 @@ def index():
|
||||
@app.route("/login", methods = ["GET", "POST"])
|
||||
def login():
|
||||
if request.method == "POST":
|
||||
session["username"] = request.form["username"]
|
||||
if 'login' in request.referrer:
|
||||
return redirect(url_for('index'))
|
||||
if request.form["password"] == "tool":
|
||||
session["username"] = request.form["username"]
|
||||
if 'login' in request.referrer:
|
||||
return redirect(url_for('index'))
|
||||
else:
|
||||
return redirect(request.referrer)
|
||||
else:
|
||||
return redirect(request.referrer)
|
||||
return 'Error: Wrong username or password! <a href="login">login</a>'
|
||||
return render_template("login.html")
|
||||
|
||||
@app.route("/logout")
|
||||
|
@ -4,8 +4,8 @@
|
||||
<h1>Login</h1>
|
||||
<b>Please login:</b><br><br>
|
||||
<form method="post" action="login">
|
||||
username: <input type="text" name="username"><br>
|
||||
password: <input type="password" name="password"><br>
|
||||
<input type="text" name="username" value="username"><br>
|
||||
<input type="password" name="password" value="password"><br>
|
||||
<input type="submit" value="login">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user