Management UI for roles, users, tenants

This commit is contained in:
Shaun Walker
2019-09-30 23:50:10 -04:00
parent 7f6f9427e9
commit 4de8572a87
23 changed files with 902 additions and 124 deletions

View File

@ -136,10 +136,19 @@ namespace Oqtane.Controllers
// PUT api/<controller>/5
[HttpPut("{id}")]
[Authorize]
public User Put(int id, [FromBody] User User)
public async Task<User> Put(int id, [FromBody] User User)
{
if (ModelState.IsValid)
{
if (User.Password != "")
{
IdentityUser identityuser = await IdentityUserManager.FindByNameAsync(User.Username);
if (identityuser != null)
{
identityuser.PasswordHash = IdentityUserManager.PasswordHasher.HashPassword(identityuser, User.Password);
await IdentityUserManager.UpdateAsync(identityuser);
}
}
User = Users.UpdateUser(User);
}
return User;