<% title "Edit Login Credentials: #{@user.name}" %> <%= link_to @user.name, @user %> → Edit Login settings

Edit Login Settings

<%= form_for @user, url: update_login_user_path(@user), method: :put do |f| %>
New email <%= f.text_field :email %>
New password <%= f.password_field :password %>
Repeat new password <%= f.password_field :password_confirmation %>

2FA Enabled <%= f.check_box :totp_enabled %>
TOTP Secret <% if !@user.totp_enabled? %> <%= f.text_field :totp_secret, :readonly => true %> <% else %> 2FA is currently enabled. Disable 2FA to generate a new secret. <% end %>

<% if !@user.totp_enabled? %> <% end %>
Current password <%= password_field_tag :current_password, nil, disabled: !@user.is?(current_user) %>
TOTP Code <%= text_field_tag :totp_code, nil, disabled: !@user.is?(current_user) %>
Leave this field blank if you are not enabling 2FA.

<%= f.submit "Save Changes", class: "btn blue left" %>

<% end %>