hi
Let me check it remotely. Thanks Join and share your screen. https://us05web.zoom.us/j/85451578578?pwd=vb4VkbCXwW0IIh2GaBAriuIHoG6g5c.1
ok, Please remove the logs.txt and restart the website, then share the logs again. Thanks
hi
System.IO.FileNotFoundException: Signing Certificate couldn't found: /var/www/ebiz/api/authserver.pfx
Please check the file.
MessageText: relation "AbpBackgroundJobs" does not exist
Have you change the TablePrefix ?
No problem
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
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>();
//....
}
}