ok, please make the repo private.
Hi,
Okay, Because the Blazor server is handled over a SignalR connection, you also need to add a HubFilter
to check the current user
https://learn.microsoft.com/en-us/aspnet/core/signalr/hub-filters?view=aspnetcore-7.0#create-hub-filters
Hi,
Can you share a minimal reproducible project with me? I will check it. shiwei.liang@volosoft.com
Ok, I'm closing this.
Hi,
The configuration of Blazor server is basically the same as MVC, you can refer to it
Hi,
This has nothing to do with ABP. :). This is the behavior of Kafka API
Hi,
You can try :
Blazor server project
app.UseAuthorization();
app.Use(async (httpContext, func) =>
{
var currentUser = httpContext.RequestServices.GetRequiredService<ICurrentUser>();
if (currentUser.IsAuthenticated && !httpContext.Request.Path.ToString().Contains("account/logout", StringComparison.InvariantCultureIgnoreCase))
{
var userAppService = httpContext.RequestServices.GetRequiredService<IIdentityUserAppService>();
var user = await userAppService.GetAsync(currentUser.GetId());
// you can also use cache
if (claimToken != user.GetProperty(ConcurrentLoginConsts.ConcurrentLoginToken).ToString())
{
httpContext.Response.Redirect("/Account/logout");
return;
}
}
await func();
});
Hi,
I can't reproduce the problem
public abstract class TmAppService : ApplicationService
{
protected TmAppService()
{
LocalizationResource = typeof(TmResource);
}
}
public class TestAppService : TmAppService, ITestAppService
{
public Task<TieredLayerCreateOrUpdateDto> TestAsync(TieredLayerCreateOrUpdateDto input)
{
return Task.FromResult(input);
}
}
public class TieredLayerCreateOrUpdateDto : FullAuditedEntityDto<int>, IHasConcurrencyStamp
{
//public int? Id { get; set; }
[Required]
public string TieredLevelName { get; set; } = null!;
public decimal LowerLimit { get; set; }
public decimal? UpperLimit { get; set; }
public decimal Rate { get; set; }
public int? BillingItemId { get; set; }
public string? ConcurrencyStamp { get; set; } = null!;
}
public interface ITestAppService: IApplicationService
{
Task<TieredLayerCreateOrUpdateDto> TestAsync(TieredLayerCreateOrUpdateDto input);
}
Hi,
You can refer the project I shared.