summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-22 11:27:37 +0200
committerJames Lopez <james@jameslopez.es>2017-06-23 11:41:42 +0200
commitc9fd3dc42c462ce2551f6a9630035b4df00bc366 (patch)
tree5e4bd5226fff9fa00ba9db17056d21a59db527d7 /lib/api/internal.rb
parent785cbb79e255c8369ca5eb916207304f39d188ad (diff)
downloadgitlab-ce-c9fd3dc42c462ce2551f6a9630035b4df00bc366.tar.gz
more refactoring based on feedback
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 8606ff75e11..ecfc822ba6a 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -132,10 +132,11 @@ module API
return { success: false, message: 'Two-factor authentication is not enabled for this user' }
end
- codes = user.generate_otp_backup_codes!
- ::Users::UpdateService.new(user, user).execute!
+ ::Users::UpdateService.new(user, user).execute! do |user|
+ @codes = user.generate_otp_backup_codes!
+ end
- { success: true, recovery_codes: codes }
+ { success: true, recovery_codes: @codes }
end
post "/notify_post_receive" do