ABP Commercial 7.4.2 / Blazor Server / EF / Non tiered / Separate Host and Tenant DBs / Lepton Theme
Hi,
How can I get the password complexity requirements setup in ABP Settings for use in JS on the front-end Registration page?
Is there a Service that can be injected for use in the Registration page?
I tried the following, but it returns the default password settings from MS instead of the values set in the ABP Settings page.
private readonly IdentityOptions _identityOptions;
public nVisionRegisterModel(IOptions<IdentityOptions> identityOptions) : base ()
{
_identityOptions = identityOptions.Value;
}
Thanks in advance!
2 Answer(s)
-
0
For anyone running into the same issue, you just need to inject ABP's
ISettingProvider
See ABP's documentation
-
0
Hi,
ABP will override the default value using the setting value
https://github.com/abpframework/abp/blob/260507ff4ed476d42efbd2012c545adf99bb0c28/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityOptionsManager.cs
You need to call the
SetAsync
first: https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.csprotected IOptions<IdentityOptions> IdentityOptions { get; } .... await IdentityOptions.SetAsync();