dang
This commit is contained in:
parent
ffee6e1193
commit
575564031a
10
main.go
10
main.go
|
@ -47,7 +47,7 @@ func main() {
|
|||
e.Type = "text"
|
||||
e.Validator = "email"
|
||||
e.FailMessage = "Must be a valid email address"
|
||||
e.Name = "email"
|
||||
e.Name = "theemail"
|
||||
f.Add(e)
|
||||
|
||||
e = forms.NewElement()
|
||||
|
@ -56,7 +56,7 @@ func main() {
|
|||
e.Validator = ""
|
||||
e.Autocomplete = "new-password"
|
||||
e.FailMessage = "Passsword Incorrect"
|
||||
e.Name = "oldpassword"
|
||||
e.Name = "theoldpassword"
|
||||
f.Add(e)
|
||||
|
||||
e = forms.NewElement()
|
||||
|
@ -125,14 +125,14 @@ func main() {
|
|||
defer c.Quit()
|
||||
|
||||
// Authenticate.
|
||||
if err := c.Auth(f.GetValue("email"), f.GetValue("oldpassword")); err != nil {
|
||||
f.MakeInvalid("oldpassword", "Invalid password")
|
||||
if err := c.Auth(f.GetValue("theemail"), f.GetValue("theoldpassword")); err != nil {
|
||||
f.MakeInvalid("theoldpassword", "Invalid password")
|
||||
d.Body = f.Render(true)
|
||||
tmpl.Execute(w, d)
|
||||
return
|
||||
}
|
||||
// Change the password
|
||||
if !modifyPasswordFile(f.GetValue("email"), f.GetValue("newpassword")) {
|
||||
if !modifyPasswordFile(f.GetValue("theemail"), f.GetValue("newpassword")) {
|
||||
log.Println(err)
|
||||
d.Body = "Internal error"
|
||||
tmpl.Execute(w, d)
|
||||
|
|
Loading…
Reference in New Issue