diff options
author | Robert Speicher <robert@gitlab.com> | 2018-01-03 19:23:39 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-01-03 19:23:39 +0000 |
commit | ea55445dad4e11a16ab6eec58c85198870bd1f40 (patch) | |
tree | 1a3f519be9c3a5ccde846d727afeea07e67bd632 | |
parent | 54bc270f7e90f4bd15d6958e44d0a8f41a3eb571 (diff) | |
parent | 540a2b67098782842cfdd98b4177a29ac3c81ebf (diff) | |
download | gitlab-ce-ea55445dad4e11a16ab6eec58c85198870bd1f40.tar.gz |
Merge branch 'fix/move-2fa-disable-button' into 'master'
Move 2FA disable button #35836
Closes #35836
See merge request gitlab-org/gitlab-ce!16177
-rw-r--r-- | app/views/profiles/accounts/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/profiles/two_factor_auths/show.html.haml | 9 | ||||
-rw-r--r-- | changelogs/unreleased/fix-move-2fa-disable-button.yml | 5 | ||||
-rw-r--r-- | spec/features/u2f_spec.rb | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml index ced58dffcdc..f1313b79589 100644 --- a/app/views/profiles/accounts/show.html.haml +++ b/app/views/profiles/accounts/show.html.haml @@ -17,10 +17,6 @@ Status: #{current_user.two_factor_enabled? ? 'Enabled' : 'Disabled'} - if current_user.two_factor_enabled? = link_to 'Manage two-factor authentication', profile_two_factor_auth_path, class: 'btn btn-info' - = link_to 'Disable', profile_two_factor_auth_path, - method: :delete, - data: { confirm: "Are you sure? This will invalidate your registered applications and U2F devices." }, - class: 'btn btn-danger' - else .append-bottom-10 = link_to 'Enable two-factor authentication', profile_two_factor_auth_path, class: 'btn btn-success' diff --git a/app/views/profiles/two_factor_auths/show.html.haml b/app/views/profiles/two_factor_auths/show.html.haml index 0b03276efcc..5207dac3ac2 100644 --- a/app/views/profiles/two_factor_auths/show.html.haml +++ b/app/views/profiles/two_factor_auths/show.html.haml @@ -1,5 +1,5 @@ - page_title 'Two-Factor Authentication', 'Account' -- add_to_breadcrumbs("Account", profile_account_path) +- add_to_breadcrumbs("Two-Factor Authentication", profile_account_path) - @content_class = "limit-container-width" unless fluid_layout = render 'profiles/head' @@ -18,7 +18,12 @@ Use an app on your mobile device to enable two-factor authentication (2FA). .col-lg-8 - if current_user.two_factor_otp_enabled? - = icon "check inverse", base: "circle", class: "text-success", text: "You've already enabled two-factor authentication using mobile authenticator applications. You can disable it from your account settings page." + %p + You've already enabled two-factor authentication using mobile authenticator applications. In order to register a different device, you must first disable two-factor authentication. + = link_to 'Disable two-factor authentication', profile_two_factor_auth_path, + method: :delete, + data: { confirm: "Are you sure? This will invalidate your registered applications and U2F devices." }, + class: 'btn btn-danger' - else %p Download the Google Authenticator application from App Store or Google Play Store and scan this code. diff --git a/changelogs/unreleased/fix-move-2fa-disable-button.yml b/changelogs/unreleased/fix-move-2fa-disable-button.yml new file mode 100644 index 00000000000..bac98ad5148 --- /dev/null +++ b/changelogs/unreleased/fix-move-2fa-disable-button.yml @@ -0,0 +1,5 @@ +--- +title: Move 2FA disable button +merge_request: 16177 +author: George Tsiolis +type: fixed diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb index c9afef2a8de..50ee1656e10 100644 --- a/spec/features/u2f_spec.rb +++ b/spec/features/u2f_spec.rb @@ -264,7 +264,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do end it "deletes u2f registrations" do - visit profile_account_path + visit profile_two_factor_auth_path expect do accept_confirm { click_on "Disable" } end.to change { U2fRegistration.count }.by(-1) |