15 lines
532 B
Python
15 lines
532 B
Python
import flask
|
|
import database
|
|
|
|
page = flask.Blueprint("login", __name__, template_folder="templates")
|
|
|
|
@page.route("/login", methods=['POST', 'GET'])
|
|
def show():
|
|
if (flask.request.method == 'GET'):
|
|
return (flask.render_template("login/login.html"))
|
|
email = flask.request.form['email']
|
|
password = flask.request.form['password']
|
|
if (database.database.account_test(email, password)):
|
|
return (flask.render_template("login/login.html", error = "Invalid credentials"))
|
|
return (flask.redirect("/panel"))
|