diff --git a/.gitignore b/.gitignore index e4e5f6c..1054fbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*~ \ No newline at end of file +*~ +app/__pycache__ \ No newline at end of file diff --git a/app/app.py b/app/app.py index 2df8db2..705ac08 100644 --- a/app/app.py +++ b/app/app.py @@ -48,19 +48,15 @@ def index(): return flask.render_template("index.html", bookList = bookQry) - @app.route("/about") def about(): return flask.render_template("about.html") - - @app.route("/login", methods=["GET", "POST"]) def login(): - prev = flask.request.args.get("prev") if not prev: - prev == "index" + prev = "index" if flask.request.method == "POST": #Get data @@ -224,10 +220,12 @@ def updateUser(userId): if flask.request.method == "POST": logging.warning("------------------------") current = flask.request.form.get("current") + hashedCurrent = hashlib.sha512(current.encode()).hexdigest() password = flask.request.form.get("password") + hashedPw = hashlib.sha512(password.encode()).hexdigest() if current: - if current == thisUser.password: - thisUser.password = password + if hashedCurrent == thisUser.password: + thisUser.password = hashedPw db.session.commit() else: flask.flash("Current Password is incorrect")