0
bilalhaidar created
Hello,
I noticed something which doesn't make sense in the AppSettingProvider when it comes to adding a new SettingDefinition for the AllowSelfRegistration.
The code uses
ConfigurationManager.AppSettings[AppSettings.TenantMangement.UseCaptchaOnRegistration]
Should it use something like this?
ConfigurationManager.AppSettings[AppSettings.TenantMangement.AllowSelfRegistration]
This is the code for the AppSettingsProvider I have:
public class AppSettingProvider : SettingProvider
{
public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
{
context.Manager.GetSettingDefinition(AbpZeroSettingNames.UserManagement.TwoFactorLogin.IsEnabled).DefaultValue = false.ToString().ToLowerInvariant();
var defaultPasswordComplexitySetting = new PasswordComplexitySetting
{
MinLength = 6,
MaxLength = 15,
UseNumbers = true,
UseUpperCaseLetters = false,
UseLowerCaseLetters = true,
UsePunctuations = false,
};
return new[]
{
//Host settings
new SettingDefinition(AppSettings.TenantManagement.AllowSelfRegistration,ConfigurationManager.AppSettings[AppSettings.TenantManagement.UseCaptchaOnRegistration] ?? "true"),
new SettingDefinition(AppSettings.TenantManagement.IsNewRegisteredTenantActiveByDefault,ConfigurationManager.AppSettings[AppSettings.TenantManagement.IsNewRegisteredTenantActiveByDefault] ??"false"),
new SettingDefinition(AppSettings.TenantManagement.UseCaptchaOnRegistration,ConfigurationManager.AppSettings[AppSettings.TenantManagement.UseCaptchaOnRegistration] ?? "true"),
new SettingDefinition(AppSettings.TenantManagement.DefaultEdition,ConfigurationManager.AppSettings[AppSettings.TenantManagement.DefaultEdition] ?? ""),
new SettingDefinition(AppSettings.Security.PasswordComplexity, defaultPasswordComplexitySetting.ToJsonString(),scopes: SettingScopes.Application | SettingScopes.Tenant),
//Tenant settings
new SettingDefinition(AppSettings.UserManagement.AllowSelfRegistration, ConfigurationManager.AppSettings[AppSettings.UserManagement.UseCaptchaOnRegistration] ?? "true", scopes: SettingScopes.Tenant),
new SettingDefinition(AppSettings.UserManagement.IsNewRegisteredUserActiveByDefault, ConfigurationManager.AppSettings[AppSettings.UserManagement.IsNewRegisteredUserActiveByDefault] ?? "false", scopes: SettingScopes.Tenant),
new SettingDefinition(AppSettings.UserManagement.UseCaptchaOnRegistration, ConfigurationManager.AppSettings[AppSettings.UserManagement.UseCaptchaOnRegistration] ?? "true", scopes: SettingScopes.Tenant)
};
}
}
Thank you, Bilal
3 Answer(s)
-
0
Hi,
Thank you, this is a bug. Can you create a bug record here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/issues">https://github.com/aspnetzero/aspnet-zero/issues</a>
-
0
Done
-
0
Thanks, we will fix it soon.