diff options
Diffstat (limited to 'app/views/users/edit_login.html.erb')
-rw-r--r-- | app/views/users/edit_login.html.erb | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/app/views/users/edit_login.html.erb b/app/views/users/edit_login.html.erb index 2fb9903..c55ace7 100644 --- a/app/views/users/edit_login.html.erb +++ b/app/views/users/edit_login.html.erb @@ -1,7 +1,7 @@ <% title "Edit Login Credentials: #{@user.name}" %> -<%= link_to @user.name, @user %> → Edit Login credentials -<h1>Edit Login Credentials</h1> +<%= link_to @user.name, @user %> → Edit Login settings +<h1>Edit Login Settings</h1> <%= form_for @user, url: update_login_user_path(@user), method: :put do |f| %> @@ -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> |