Don't show "Two-factor authentication" on new user form
|Assignee:||Go MAEDA||% Done:|
|Category:||Accounts / authentication|
"Two-factor authentication" on a new user form is always showing "Not activated". Of course, this is because a user about to be created can never activate it.
I think it should be removed from the new user form. The item "Two-factor authentication" is necessary when editing an existing user, but is not useful when creating a new user because it always, only shows "Two-factor authentication: Not activated".
The indication not only useless but sometimes confuses admins. In my observation, some people misunderstood that two-factor authentication cannot be used on the Redmine instance.
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index ab9f7b541..4b030d920 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -42,7 +42,7 @@ <p><%= f.check_box :generate_password %></p> <p><%= f.check_box :must_change_passwd %></p> </div> - <% if Setting.twofa? -%> + <% if Setting.twofa? && !@user.new_record? -%> <p> <label><%=l :setting_twofa -%></label> <% if @user.twofa_active? %>