Permalink
Browse files

Only reset users's uniqueId when form validation succeeds, not when s…

…howing the form.

This makes it possible to actually correct any validation errors without resending an email.
  • Loading branch information...
1 parent 8a44406 commit d32aa899c86e231838cdc1e74818fbfd12480c9d @jeppenejsum jeppenejsum committed Nov 18, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 persistence/proto/src/main/scala/net/liftweb/proto/ProtoUser.scala
@@ -967,14 +967,12 @@ trait ProtoUser {
def finishSet() {
user.validate match {
case Nil => S.notice(S.??("password.changed"))
- user.save
+ user.resetUniqueId().save
logUserIn(user, () => S.redirectTo(homePage))
case xs => S.error(xs)
}
}
- user.resetUniqueId().save
-
bind("user", passwordResetXhtml,
"pwd" -> SHtml.password_*("",(p: List[String]) =>
user.setPasswordFromListString(p)),
@@ -1066,7 +1064,7 @@ trait ProtoUser {
}
def innerEdit = bind("user", editXhtml(theUser),
- "submit" -> editSubmitButton(S.??("edit"), testEdit _))
+ "submit" -> editSubmitButton(S.??("save"), testEdit _))
innerEdit
}

0 comments on commit d32aa89

Please sign in to comment.