def login_check(): # validate username and password username = request.form.get("username") password = request.form.get("password") person = User.get(username) try: if person and person.verifyPass(password): login_user(person) return redirect("/profile", code=200) else: print("fail") return render_template("Login.html", status=["wrong_combination", "warning"]) except Exception as ex: print("except: %s" % ex) return render_template("Login.html", status=["outdated_database", "error"])
def login_check(): # validate username and password username = request.form.get('username') password = request.form.get('password') person = User.get(username) try: if person and person.verifyPass(password): login_user(person) return redirect("/profile", code=200) else: print("fail") return render_template('Login.html', status=["wrong_combination", "warning"]) except Exception as ex: print("except: %s" % ex) return render_template('Login.html', status=["outdated_database", "error"])
def load_user(id): return User.get(id)