Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project/target
target
tmp
.idea
*.iml
Play20StartApp.iml
db
.classpath
Expand Down
15 changes: 15 additions & 0 deletions app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public static class Register {
@Constraints.Required
public String inputPassword;

@Constraints.Required
public String confirmPassword;

/**
* Validate the authentication.
*
Expand All @@ -107,6 +110,18 @@ public String validate() {
return "Password is required";
}

if (isBlank(confirmPassword)) {
return "Confirm Password is required";
}

if (isBlank(confirmPassword)) {
return "Confirm Password is required";
}

if (!inputPassword.equals(confirmPassword)) {
return "Passwords do not match";
}

return null;
}

Expand Down
5 changes: 5 additions & 0 deletions app/views/account/signup/createFormOnly.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ <h3>@Messages("signup.new")</h3>
'_label -> null,
'placeholder -> Messages("password")
)
@inputPassword(
signupForm("confirmPassword"),
'_label -> null,
'placeholder -> Messages("confirmPassword")
)
<h6>@Messages("signup.generate.password")</h6>
<input type="text" name="passwordGenerated" />
</fieldset>
Expand Down
1 change: 1 addition & 0 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ fullname=Full Name
goback=Go Back
logout=Logout
password=Password
confirmPassword=Confirm Password
error.technical=Technical Error, please Retry
validate=Validate
reset=Reset
Expand Down
1 change: 1 addition & 0 deletions conf/messages.fr
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fullname=Nom Complet
goback=Retour
logout=Déconnexion
password=Mot de passe
confirmPassword=Confirmation du mot de passe
error.technical=Erreur Technique, veuillez retenter
validate=Valider
reset=Valider
Expand Down