Activities of "liangshiwei"

Hi,

Can you share the full HTTP request and response?

HI,

Sorry my bad, please try:

var tokenHeaderName = abp.security.antiForgery.tokenHeaderName;
var token = abp.security.antiForgery.getToken();

new Dropzone('....',{  
    .......... 
    headers: {  
        tokenHeaderName : token
    } 
    .... 
}); 

Hi,

What happens when you use abp.security.antiForgery.tokenHeaderName and abp.security.antiForgery.getToken() in the browser's console tab?

Hi,

You can try sharing logs with google drive or one drive.

Hi,

I guess you need to add antiForgeryToken to the request header.

Try:

new Dropzone('....',{ 
    ..........
    headers: { 
        abp.security.antiForgery.tokenHeaderName: abp.security.antiForgery.getToken()
    }
    ....
});

Hi,

This is a problem with the template, we will fix it. ps: your ticket refunded

For now, you can try:

Add typeof(<YouProjectName>HttpApiModule) to <YouProjectName>WebModule and remove typeof(AbpHttpClientWebModule), it should be work.

Hi,

Can you share detail logs? (include identityServer and HttpApi.Host)

Hi,

You can use RabbitMQ only for background jobs, remove all AbpEventBusRabbitMqModule from your solution.then you can safely remove Rabbitmq's EventBus configuration.

Hi,

We will check it.

Hi,

Please try:

public static class RefreshRolesMiddlewareExtension
{
    public static IApplicationBuilder UseRefreshRolesMiddleware(this IApplicationBuilder app)
    {
        return app.Use(async (ctx, next) =>
        {
            var currentUser = ctx.RequestServices.GetRequiredService<ICurrentUser>();

            if (!currentUser.IsAuthenticated)
            {
                await next();
                return;
            }

            var userManager = ctx.RequestServices.GetRequiredService<IdentityUserManager>();

            var currentPrincipalAccessor = ctx.RequestServices.GetRequiredService<ICurrentPrincipalAccessor>();
            var user = await userManager.GetByIdAsync(currentUser.GetId());
            var roles= await userManager.GetRolesAsync(user);

            currentPrincipalAccessor.Principal.Identities.First().AddClaims(roles.Select(x=> new Claim(AbpClaimTypes.Role, x)));

            await next();

        });
    }
}
Showing 4711 to 4720 of 6043 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 19, 2024, 12:56