diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/ldap/access.rb | 3 |
2 files changed, 5 insertions, 5 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 diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb index 7430db828a3..998a8a7eb35 100644 --- a/lib/gitlab/ldap/access.rb +++ b/lib/gitlab/ldap/access.rb @@ -16,8 +16,7 @@ module Gitlab def self.allowed?(user) self.open(user) do |access| if access.allowed? - user.last_credential_check_at = Time.now - Users::UpdateService.new(user, user).execute + Users::UpdateService.new(user, user, last_credential_check_a: Time.now).execute true else |