Browse Source

Wrong password feedback and no need to expose password requirements at login

current_wdka_release
crunk 3 years ago
parent
commit
b4b9b7ed58
  1. 2
      verse/forms/loginform.py
  2. 2
      verse/start.py

2
verse/forms/loginform.py

@ -18,6 +18,6 @@ class LoginForm(FlaskForm):
validators=[validators.InputRequired(), Email(), Length(6, 64)], validators=[validators.InputRequired(), Email(), Length(6, 64)],
) )
password = PasswordField( password = PasswordField(
"Password:", validators=[validators.InputRequired(), Length(12, 72)] "Password:", validators=[validators.InputRequired()]
) )
submit = SubmitField("Sign In") submit = SubmitField("Sign In")

2
verse/start.py

@ -81,6 +81,8 @@ def login():
return redirect(next or url_for("index")) return redirect(next or url_for("index"))
else: else:
flash("Invalid Username or password!", "danger") flash("Invalid Username or password!", "danger")
loginform.password.errors.append("Invalid email or password!")
return render_template("login.html", loginform=loginform)
except Exception as e: except Exception as e:
flash(e, "danger") flash(e, "danger")
return render_template("login.html", loginform=loginform) return render_template("login.html", loginform=loginform)

Loading…
Cancel
Save