Activities of "maliming"

No problem

hi

Your logs file exists on Logs/logs.txt, Please check the publish folder of your website.

sorry, you can't do that in the LoggedOutModel class

Yes, you can't do that in the LoggedOutModel class

hi

You can't get user info in the LoggedOutModel class. so you can't output a username to security logs.

hi

We have output the log on LogoutModel. Why you are overriding the LoggedOutModel?

HI

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;

namespace BookStore;

public class MyRoleValidator : IRoleValidator<IdentityRole>
{

    public MyRoleValidator(IdentityErrorDescriber? errors = null)
    {
        Describer = errors ?? new IdentityErrorDescriber();
    }

    private IdentityErrorDescriber Describer { get; set; }


    public virtual async Task<IdentityResult> ValidateAsync(RoleManager<IdentityRole> manager, IdentityRole role)
    {
        if (manager == null)
        {
            throw new ArgumentNullException(nameof(manager));
        }

        if (role == null)
        {
            throw new ArgumentNullException(nameof(role));
        }

        var errors = new List<IdentityError>();
        await ValidateRoleName(manager, role, errors).ConfigureAwait(false);
        if (errors.Count > 0)
        {
            return IdentityResult.Failed(errors.ToArray());
        }
        return IdentityResult.Success;
    }

    private async Task ValidateRoleName(RoleManager<IdentityRole> manager, IdentityRole role, ICollection<IdentityError> errors)
    {
        var roleName = await manager.GetRoleNameAsync(role).ConfigureAwait(false);
        if (string.IsNullOrWhiteSpace(roleName))
        {
            errors.Add(Describer.InvalidRoleName(roleName));
        }
        else
        {
            // Add your custom validation here

            // var owner = await manager.FindByNameAsync(roleName).ConfigureAwait(false);
            // if (owner != null &&
            //     !string.Equals(await manager.GetRoleIdAsync(owner).ConfigureAwait(false), await manager.GetRoleIdAsync(role).ConfigureAwait(false)))
            // {
            //     errors.Add(Describer.DuplicateRoleName(roleName));
            // }
        }
    }
}

public class BookStoreDomainModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.RemoveAll(x => x.ServiceType == typeof(IRoleValidator<IdentityRole>));
        context.Services.AddScoped<IRoleValidator<IdentityRole>, MyRoleValidator>();
        //....
    }
}

hi

Please share the code of yourlogout code, Thanks

Hi

Add your code into CurrentPrincipalAccessor' changescope.

var userPrincipal = await SignInManager.CreateUserPrincipalAsync(user); 
using (CurrentPrincipalAccessor.Change(userPrincipal)) 
{ 
      await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext()
      {
          Identity = IdentitySecurityLogIdentityConsts.IdentityExternal,
          Action = "Login" + result
      });
} 
var userPrincipal = await SignInManager.CreateUserPrincipalAsync(user); 
using (CurrentPrincipalAccessor.Change(userPrincipal)) 
{ 
       await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext()
      {
              Identity = IdentitySecurityLogIdentityConsts.IdentityExternal,
              Action = result.ToIdentitySecurityLogAction(),
              UserName = user.Name
      });
} 

hi

sorry, You can add the class to Identity Domain or FapRat Domain.

Showing 7501 to 7510 of 12924 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on November 02, 2026, 06:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.