diff options
author | James Lopez <james@jameslopez.es> | 2017-06-23 17:11:31 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-23 17:11:31 +0200 |
commit | b33c638483d6b87ba71a329275ff12e5eb865d72 (patch) | |
tree | af7f0c3caac54bad865e651654772d575d9d0e4b /lib/api/internal.rb | |
parent | 8f2adb8084c15026115aed39a06e9af04c5e7957 (diff) | |
download | gitlab-ce-b33c638483d6b87ba71a329275ff12e5eb865d72.tar.gz |
update code based on feedback
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r-- | lib/api/internal.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 9b035808693..f1c79970ba4 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -132,11 +132,13 @@ module API return { success: false, message: 'Two-factor authentication is not enabled for this user' } end + codes = nil + ::Users::UpdateService.new(user).execute! do |user| - @codes = user.generate_otp_backup_codes! + codes = user.generate_otp_backup_codes! end - { success: true, recovery_codes: @codes } + { success: true, recovery_codes: codes } end post "/notify_post_receive" do |