Hi,
We have created an internal issue for this. it will fix soon.
Hi,
We have fixed this problem: https://github.com/abpframework/abp/pull/6649
For now, you can try to clear the brower cookies.
Hi,
We have enabled swagger login for HostWithIds project: https://github.com/abpframework/abp/pull/6818
Hi,
I have updated code, please try again. PS: The sample code just provides an idea, you should improve it as needed
Can I check it remotely? shiwei.liang@volosoft.com
Can I check it remotely? shiwei.liang@volosoft.com
Hi,
I think you can use page filter, like:
public class UserInfoCheckPageFilter : IAsyncPageFilter, ITransientDependency
{
private readonly ICurrentUser _currentUser;
private readonly IdentityUserManager _identityUserManager;
private static readonly List<string> IgnoreUrls = new() {"/account/userinfo"};
public UserInfoCheckPageFilter(ICurrentUser currentUser, IdentityUserManager identityUserManager)
{
_currentUser = currentUser;
_identityUserManager = identityUserManager;
}
public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context)
{
return Task.CompletedTask;
}
public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next)
{
if (!_currentUser.Id.HasValue || IgnoreUrls.Any(url => context.HttpContext.Request.Path.ToString().ToLower().Contains(url)) )
{
await next.Invoke();
return;
}
var user = await _identityUserManager.GetByIdAsync(_currentUser.GetId());
//check user information...
if (user.PhoneNumber.IsNullOrWhiteSpace())
{
context.Result = new RedirectResult("/account/userinfo");
return;
}
await next.Invoke();
}
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<MvcOptions>(options =>
{
options.Filters.Add(typeof(UserInfoCheckPageFilter));
});
}
Hi,
I can't reproduce your problem, can you provide more steps? thanks.