-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EC-198 Added feature flag for 2FA Email for new device login #1993
EC-198 Added feature flag for 2FA Email for new device login #1993
Conversation
…ce login given that we can now rely on the global settings feature flag
src/Core/Settings/GlobalSettings.cs
Outdated
@@ -69,6 +69,7 @@ public virtual string LicenseDirectory | |||
public virtual AppleIapSettings AppleIap { get; set; } = new AppleIapSettings(); | |||
public virtual SsoSettings Sso { get; set; } = new SsoSettings(); | |||
public virtual StripeSettings Stripe { get; set; } = new StripeSettings(); | |||
public virtual TwoFactorAuthSettings TwoFactorAuth { get; set; } = new TwoFactorAuthSettings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add these as interfaces and define them in src/Core/Settings
? It makes testing more straightforwad
@@ -84,8 +82,7 @@ public class UserService : UserManager<User>, IUserService, IDisposable | |||
GlobalSettings globalSettings, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this to an IGlobalSettings
to enable testing
sutProvider.GetDependency<Settings.GlobalSettings>().TwoFactorAuth = new Settings.GlobalSettings.TwoFactorAuthSettings | ||
{ | ||
EmailOnNewDeviceLogin = true | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're trying to get away from using our default global settings injector.
Once you make the changes to inject and interface you should be able to:
sutProvider.GetDependency<IGlobalSettings>().TwoFactorAuth.EmailOnNewDevice.Returns(true)
sutProvider.GetDependency<Settings.GlobalSettings>().TwoFactorAuth = new Settings.GlobalSettings.TwoFactorAuthSettings | ||
{ | ||
EmailOnNewDeviceLogin = false | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same mocking comment as above
* EC-198 added global setting flag for 2FA email on new device login feature * EC-198 Removed is development environment check on 2FA email new device login given that we can now rely on the global settings feature flag * EC-198 Improved IGlobalSettings and UserService code for testing
Type of change
Objective
Add feature flag for 2FA Email for new device login so we can disable the need to ask for 2FA email on new device logins by configuration.
Code changes
Before you submit
dotnet tool run dotnet-format --check
) (required)