Merge pull request #2065 from sbwalker/dev
Resolved issue in TenantManager resulting in "No database provider has been configured for this DbContext" error being logged during startup. Added logic to update email address in AspNetUsers when updating a User.
This commit is contained in:
commit
c7cad20aa7
@ -254,14 +254,15 @@ namespace Oqtane.Controllers
|
||||
{
|
||||
if (ModelState.IsValid && user.SiteId == _tenantManager.GetAlias().SiteId && _users.GetUser(user.UserId, false) != null && (User.IsInRole(RoleNames.Admin) || User.Identity.Name == user.Username))
|
||||
{
|
||||
if (user.Password != "")
|
||||
IdentityUser identityuser = await _identityUserManager.FindByNameAsync(user.Username);
|
||||
if (identityuser != null)
|
||||
{
|
||||
IdentityUser identityuser = await _identityUserManager.FindByNameAsync(user.Username);
|
||||
if (identityuser != null)
|
||||
identityuser.Email = user.Email;
|
||||
if (user.Password != "")
|
||||
{
|
||||
identityuser.PasswordHash = _identityUserManager.PasswordHasher.HashPassword(identityuser, user.Password);
|
||||
await _identityUserManager.UpdateAsync(identityuser);
|
||||
}
|
||||
await _identityUserManager.UpdateAsync(identityuser);
|
||||
}
|
||||
user = _users.UpdateUser(user);
|
||||
_syncManager.AddSyncEvent(_tenantManager.GetAlias().TenantId, EntityNames.User, user.UserId);
|
||||
|
@ -54,23 +54,6 @@ namespace Oqtane.Infrastructure
|
||||
post.PostConfigure(name, options);
|
||||
}
|
||||
|
||||
//if (_validations.Length > 0)
|
||||
//{
|
||||
// var failures = new List<string>();
|
||||
// foreach (IValidateOptions<TOptions> validate in _validations)
|
||||
// {
|
||||
// ValidateOptionsResult result = validate.Validate(name, options);
|
||||
// if (result != null && result.Failed)
|
||||
// {
|
||||
// failures.AddRange(result.Failures);
|
||||
// }
|
||||
// }
|
||||
// if (failures.Count > 0)
|
||||
// {
|
||||
// throw new OptionsValidationException(name, typeof(TOptions), failures);
|
||||
// }
|
||||
//}
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ namespace Oqtane.Infrastructure
|
||||
{
|
||||
Alias alias = null;
|
||||
|
||||
if (_siteState != null && _siteState.Alias != null && _siteState.Alias.AliasId != -1)
|
||||
if (_siteState?.Alias != null && _siteState.Alias.AliasId != -1)
|
||||
{
|
||||
alias = _siteState.Alias;
|
||||
}
|
||||
@ -63,7 +63,7 @@ namespace Oqtane.Infrastructure
|
||||
|
||||
public Tenant GetTenant()
|
||||
{
|
||||
var alias = GetAlias();
|
||||
var alias = _siteState?.Alias;
|
||||
if (alias != null)
|
||||
{
|
||||
// return tenant details
|
||||
|
Loading…
x
Reference in New Issue
Block a user