OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Reload otp_devices to get default
Oliver Günther797bc9f08e99
diff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/device.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/device.rbindex 2c2e56290fa..862b3e0da7d 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/device.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/device.rb@@ -66,7 +66,7 @@ module TwoFactorAuthenticationDevice.transaction doDevice.where(user_id: user_id).update_all(default: false)update_column(:default, true)- return true+ trueendenddiff --git a/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb b/modules/two_factor_authentication/spec/models/devices/default_device_spec.rbindex 0433c4e57d4..fc1ea590924 100644--- a/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb+++ b/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb@@ -28,7 +28,7 @@ describe 'Default device', with_2fa_ee: true, type: :model doexpect(user.otp_devices.get_default).to eq(other_otp)subject.make_default!- expect(user.otp_devices.get_default).to eq(subject)+ expect(user.otp_devices.reload.get_default).to eq(subject)endendend