hi maliming,
I have added the user to the AbpUsers collection but I still can not login to the site
this is my code:
var connectionStringResolver = _serviceProvider.GetRequiredService<IConnectionStringResolver>();
var dbContexts = GetAbpMongoDbContexts();
var backOfficeDbContext = dbContexts.OfType<BackOfficeMongoDbContext>().FirstOrDefault();
if (backOfficeDbContext is not null)
{
var database = await GetMongoDatabase(connectionStringResolver, backOfficeDbContext);
var collection = database.GetCollection<BsonDocument>("AbpUsers");
if (collection is not null)
{
var filterUser = Builders<BsonDocument>.Filter.Eq("UserName", "abc");
var isExisted = await collection.Find(filterUser).AnyAsync();
if (!isExisted)
{
var user = new BsonDocument
{
{ "_id", new BsonBinaryData(Guid.NewGuid(), GuidRepresentation.Standard) },
{ "ConcurrencyStamp", Guid.NewGuid().ToString().Replace("-", "") },
{ "CreationTime", DateTime.UtcNow },
{ "IsDeleted", false },
{ "UserName", "abc" },
{ "NormalizedUserName", "ABC" },
{ "Name", "abc" },
{ "Email", "abc@abc.vn" },
{ "NormalizedEmail", "ABC@ABC.VN" },
{ "EmailConfirmed", true },
{ "PasswordHash", _passwordHasher.HashPassword(null, "1q2w3E*") },
{ "SecurityStamp", Guid.NewGuid().ToString().Replace("-", "") },
{ "IsExternal", false },
{ "PhoneNumber", "" },
{ "PhoneNumberConfirmed", false },
{ "TwoFactorEnabled", false },
{ "LockoutEnabled", true },
{ "AccessFailedCount", 0 },
{ "IsActive", false },
{ "ShouldChangePasswordOnNextLogin", false },
{ "EntityVersion", 0 }
};
await collection.InsertOneAsync(user);
}
}
}
It actually worked. Thanks very much!
I have added [DisableAuditing] on controller, api and IgnoredUrls on AbpAspNetCoreAuditingOptions
Hmm, that's weird, it still isn't working.
For the route "/api/app/jobs/sync-robot-drivers"
I have setup like this but doesn't work
var ignoredUrls = new[]
{
"/jobs",
};
foreach (var url in ignoredUrls)
{
options.IgnoredUrls.AddIfNotContains(url);
}
Hi @maliming, please let me know if the issue has been resolved.
hi, I have shared again
thanks
Yes, please check your mail