Fix layout of assignment and remove duplicate feedback

Resolves: #1143
This commit is contained in:
Nanne Baars 2021-11-15 21:40:48 +01:00 committed by Nanne Baars
parent b23b428763
commit f13632578d
2 changed files with 18 additions and 19 deletions

View File

@ -69,7 +69,6 @@ public class SecurePasswordsAssignment extends AssignmentEndpoint {
output.append("</ul></br>");
}
output.append("<b>Score: </b>" + strength.getScore() + "/4 </br>");
output.append("<b>Estimated cracking time in seconds: </b>" + calculateTime((long) strength.getCrackTimeSeconds().getOnlineNoThrottling10perSecond()));
if (strength.getScore() >= 4)
return success(this).feedback("securepassword-success").output(output.toString()).build();

View File

@ -22,16 +22,16 @@
method="POST" name="form"
action="/WebGoat/SecurePasswords/assignment"
autocomplete="off">
<table>
<tr>
<td><label>Password</label></td>
<td><input id="myInput" name="password" value="" type="password" placeholder="Enter a secure password"/></td>
<td><input type="checkbox" onclick="javascript:myFunction()"/>Show password</td>
</tr>
<tr>
<td><button type="SUBMIT">Submit</button></td>
</tr>
</table>
<div class="input-group input-group">
<input id="myInput" name="password" value="" type="password" class="form-control"
placeholder="Enter a secure password..."
aria-describedby="password-label">
<span class="input-group-addon"><input type="checkbox" onclick="javascript:myFunction()"/> Show password</span>
</div>
<div class="input-group" style="margin-top: 10px">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
<div class="attack-feedback"></div>
<div class="attack-output"></div>
@ -47,14 +47,14 @@
</div>
<script>
function myFunction() {
var x = document.getElementById("myInput");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
function myFunction() {
var x = document.getElementById("myInput");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>