Bugfixes on change password

This commit is contained in:
Noah 2022-08-21 18:19:30 -07:00
parent c98bc2fb33
commit c3d8b111e6
2 changed files with 4 additions and 3 deletions

View File

@ -112,8 +112,8 @@ func Settings() http.HandlerFunc {
var (
oldPassword = r.PostFormValue("old_password")
changeEmail = strings.TrimSpace(strings.ToLower(r.PostFormValue("change_email")))
password1 = strings.TrimSpace(strings.ToLower(r.PostFormValue("new_password")))
password2 = r.PostFormValue("new_password2")
password1 = strings.TrimSpace(r.PostFormValue("new_password"))
password2 = strings.TrimSpace(r.PostFormValue("new_password2"))
)
// Their old password is needed to make any changes to their account.
@ -171,6 +171,7 @@ func Settings() http.HandlerFunc {
// Changing their password?
if password1 != "" {
if password2 != password1 {
log.Error("pw1=%s pw2=%s", password1, password2)
session.FlashError(w, r, "Couldn't change your password: your new passwords do not match.")
} else {
// Hash the new password.

View File

@ -29,7 +29,7 @@
<p>
If you have found content on this site that you believe to be in violation of the
rules, please <strong>report it</strong> at TBD or e-mail
rules, please <a href="/contact?intent=report"><strong>report it</strong></a> or e-mail
<a href="mailto:abuse@nonshy.com">abuse@nonshy.com</a>.
</p>