Remember nonce to prevent replay attacks

This commit is contained in:
Omar Roth
2018-11-17 13:18:12 -06:00
parent c7f0a6f2e1
commit d185ba84bf
6 changed files with 104 additions and 76 deletions

View File

@@ -24,10 +24,11 @@
<label for="password">Password:</label>
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
<img style="width:100%" src='<%= captcha.not_nil![:challenge] %>'/>
<img style="width:100%" src='<%= captcha.not_nil![:image] %>'/>
<input type="hidden" name="token" value="<%= captcha.not_nil![:token] %>">
<label for="challenge_response">Time (h:mm):</label>
<input required type="text" name="challenge_response" type="text>" placeholder="hh:mm">
<input type="hidden" name="challenge" value="<%= captcha.not_nil![:challenge] %>">
<label for="answer">Time (h:mm):</label>
<input required type="text" name="answer" type="text>" placeholder="hh:mm">
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary">Sign In</button>
<button type="submit" name="action" value="register" class="pure-button pure-button-primary">Register</button>