diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-08-18 12:28:36 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-08-18 22:12:02 +0530 |
commit | dbedf3a61b5fe233b87b217596dea5572fc741b3 (patch) | |
tree | 2e94353c983f50cee38116e1a98df368e108cb18 /app/controllers/profiles | |
parent | a41cf621f5e4719f81efad603f0bc91f8fbe5f40 (diff) | |
download | gitlab-ce-dbedf3a61b5fe233b87b217596dea5572fc741b3.tar.gz |
Address review comments from @smcgivern.17334-u2f-device-identifiers
1. Remove an unnecessary (since we're fetching all the records anyway)
`pluck` while fetching U2F registration records.
2. Align "Your device was successfully set up!" section with the "U2F
Devices" table below.
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r-- | app/controllers/profiles/two_factor_auths_controller.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index cfa84c3bf4d..9eb75bb3891 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -92,11 +92,10 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController def setup_u2f_registration @u2f_registration ||= U2fRegistration.new @u2f_registrations = current_user.u2f_registrations - @registration_key_handles = @u2f_registrations.pluck(:key_handle) u2f = U2F::U2F.new(u2f_app_id) registration_requests = u2f.registration_requests - sign_requests = u2f.authentication_requests(@registration_key_handles) + sign_requests = u2f.authentication_requests(@u2f_registrations.map(&:key_handle)) session[:challenges] = registration_requests.map(&:challenge) gon.push(u2f: { challenges: session[:challenges], app_id: u2f_app_id, |