Hi,
Can you try this:
protected IOptions<IdentityOptions> IdentityOptions { get; } public xxx(IOptions<IdentityOptions> identityOptions) { IdentityOptions = identityOptions; } public virtual async Task CreateAsync(EmployeeCreateDto input) { await IdentityOptions.SetAsync(); // this line var email = input.Email ?? $"{input.IdentityNo}@gmail.com"; var user = new IdentityUser(Guid.NewGuid(), input.IdentityNo, email, CurrentTenant.Id); user.Surname = input.Name; var result = await _userManager.CreateAsync(user, "123456"); if (!result.Succeeded) { throw new UserFriendlyException(@L["Validation:ErrorInServer"]); } var employee = ObjectMapper.Map(input); employee.TenantId = CurrentTenant.Id; employee.AppUserId = user.Id; employee.BirthDate = input.BirthDate.ToDate().Value; employee.IdentityDate=input.IdentityDate.ToDate().Value; employee = await _employeeRepository.InsertAsync(employee, autoSave: true); return ObjectMapper.Map(employee); }
thank a lot it works well ...
I will repeat reproduce my problem
I want to create user and take Id and use it in my entity Employee as below :
public virtual async Task<EmployeeDto> CreateAsync(EmployeeCreateDto input)
{
var email = input.Email ?? $"{input.IdentityNo}@gmail.com";
var user = new IdentityUser(Guid.NewGuid(), input.IdentityNo, email, CurrentTenant.Id);
user.Surname = input.Name;
var result = await _userManager.CreateAsync(user, "123456");
if (!result.Succeeded)
{
throw new UserFriendlyException(@L["Validation:ErrorInServer"]);
}
var employee = ObjectMapper.Map<EmployeeCreateDto, Employee>(input);
employee.TenantId = CurrentTenant.Id;
employee.AppUserId = user.Id;
employee.BirthDate = input.BirthDate.ToDate().Value;
employee.IdentityDate=input.IdentityDate.ToDate().Value;
employee = await _employeeRepository.InsertAsync(employee, autoSave: true);
return ObjectMapper.Map<Employee, EmployeeDto>(employee);
}
I set password digit only and set in password setting "Required Digit Only " as below :
it does not work and give me error as below :
I hope to be reproduce my problem well .. thanks
Sorry, my bad, I thought you were using version 5.3.0, let me check it.
I am sorry my bad ..not your bad ... I was writing V 5.3.0
Hi,
We had this problem on 5.3.0, it was fixed in 5.3.1, can you upgrade to 5.3.1 and try again?
Sorry Now I use V5.0.0 Not V5.3.0 ... Can you give me principled solution for now because I use Multi Module for bussinses .and I must to upgrade all of them
Hi,
I will check it.
Ok .. I am waiting you
hello there ..
I choosed only "Require Digit"
when I add user and set password only digit from new uesr as like figure below :
it works well ..
but when I add user and set password only digit from here :
it not work and give me three errors :
can I have solution for this problem
thank ...
Can you share the application logs?
Under the
/logs
folder.2022-06-28 10:53:54.774 +03:00 [WRN] It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 4s ago, v: 2.2.4.27433 StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 4s ago, v: 2.2.4.27433 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(ConfigurationOptions configuration, TextWriter log) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 861at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token)at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token)at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)at Volo.Abp.Caching.DistributedCache
2.GetAsync(TCacheKey key, Nullable
1 hideErrors, Boolean considerUow, CancellationToken token)2022-06-28 10:54:03.930 +03:00 [WRN] It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 13s ago, v: 2.2.4.27433StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 13s ago, v: 2.2.4.27433at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(ConfigurationOptions configuration, TextWriter log) in //src/StackExchange.Redis/ConnectionMultiplexer.cs:line 861 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.GetAsync(TCacheKey key, Nullable
1 hideErrors, Boolean considerUow, CancellationToken token)
Are there any errors or does the page just spin?
And what are you using MVC/etc and separate identityserver.
So more information please
there are no errors just spin .. I wrote above..
UI type:MVC
DB provider: EF Core
Tiered (MVC) or Identity Server Separated (Angular): no
Hi there; I have created new project with public web including CMS. I have succesffully migrate database and update it. But when I try to run the project myProj.Web.Public it is not working but just keep me waiting like figure below :
thank all