summaryrefslogtreecommitdiff
path: root/app/views/users/edit_login.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/users/edit_login.html.erb')
-rw-r--r--app/views/users/edit_login.html.erb37
1 files changed, 37 insertions, 0 deletions
diff --git a/app/views/users/edit_login.html.erb b/app/views/users/edit_login.html.erb
index 2fb9903..c09bd54 100644
--- a/app/views/users/edit_login.html.erb
+++ b/app/views/users/edit_login.html.erb
@@ -25,12 +25,49 @@
<%= f.password_field :password_confirmation %>
</td>
</tr>
+ </tbody>
+ </table>
+ <hr>
+ <table>
+ <tbody>
+ <tr>
+ <td>2FA Enabled</td>
+ <td>
+ <%= f.check_box :totp_enabled %>
+ </td>
+ </tr>
+ <tr>
+ <td>TOTP Secret</td>
+ <td>
+ <% if !@user.totp_enabled? %>
+ <%= f.text_field :totp_secret, :readonly => true %>
+ <% else %>
+ <i>2FA is currently enabled. Disable 2FA to generate a new secret.</i>
+ <% end %>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <hr>
+ <table>
+ <tbody>
<tr>
<td>Current password</td>
<td>
<%= password_field_tag :current_password, nil, disabled: !@user.is?(current_user) %>
</td>
</tr>
+ <% if !@user.totp_enabled? %>
+ <tr>
+ <td>TOTP Code</td>
+ <td>
+ <%= text_field_tag :totp_code, nil, disabled: !@user.is?(current_user) %>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><i>Leave this field blank if you are not enabling 2FA.</i></td>
+ <% end %>
</tbody>
</table>
<p><%= f.submit "Save Changes", class: "btn blue left" %></p>