Merge pull request #14597 from abpframework/saas-tenant-admin-password-12067

Set tenant admin's password from host side
pull/14603/head
Halil İbrahim Kalkan 3 years ago committed by GitHub
commit f5a6d5b0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -102,4 +102,11 @@ public interface IIdentityUserRepository : IBasicRepository<IdentityUser, Guid>
bool? notActive = null,
CancellationToken cancellationToken = default
);
Task<IdentityUser> FindByTenantIdAndUserNameAsync(
[NotNull] string userName,
Guid? tenantId,
bool includeDetails = true,
CancellationToken cancellationToken = default
);
}

@ -5,6 +5,7 @@ using System.Linq.Dynamic.Core;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
@ -301,4 +302,18 @@ public class EfCoreIdentityUserRepository : EfCoreRepository<IIdentityDbContext,
{
return (await GetQueryableAsync()).IncludeDetails();
}
public virtual async Task<IdentityUser> FindByTenantIdAndUserNameAsync(
[NotNull] string userName,
Guid? tenantId,
bool includeDetails = true,
CancellationToken cancellationToken = default)
{
return await(await GetDbSetAsync())
.IncludeDetails(includeDetails)
.FirstOrDefaultAsync(
u => u.TenantId == tenantId && u.UserName == userName,
GetCancellationToken(cancellationToken)
);
}
}

@ -5,6 +5,7 @@ using System.Linq.Dynamic.Core;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using Volo.Abp.Domain.Repositories.MongoDB;
@ -269,4 +270,17 @@ public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDb
.Where(u => u.OrganizationUnits.Any(uou => organizationUnitIds.Contains(uou.OrganizationUnitId)))
.ToListAsync(cancellationToken);
}
public virtual async Task<IdentityUser> FindByTenantIdAndUserNameAsync(
[NotNull] string userName,
Guid? tenantId,
bool includeDetails = true,
CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
.FirstOrDefaultAsync(
u => u.TenantId == tenantId && u.UserName == userName,
GetCancellationToken(cancellationToken)
);
}
}

Loading…
Cancel
Save