Scala在Play框架中验证密码并确认密码

时间:2018-09-01 17:28:17

标签: scala playframework

val userForm = Form[Info](
    mapping(
      "first name" -> nonEmptyText,
      "last name" -> nonEmptyText,
      "email" -> email,

      "password" -> nonEmptyText,
  "confirm_password" -> nonEmptyText.verifying(
    "password don't match", confirm_password=> confirm_password  == "1234"
  )
    ) (Info.apply)(Info.unapply)
  )

1234 仅仅是硬编码之一,我想在该位置添加密码参数。 该怎么做?

1 个答案:

答案 0 :(得分:0)

使用int main(){ list<int> l{1,2}; list<int>::iterator q = l.begin(); operator+<int>(q,1); } 并比较verifyingpassword

confirmPassword