Budget, admin och lite css
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -36,6 +36,24 @@ namespace Aberwyn.Controllers
|
||||
ViewBag.AllRoles = allRoles;
|
||||
return View(model);
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> CreateUser(string email, string password)
|
||||
{
|
||||
var user = new ApplicationUser { UserName = email, Email = email };
|
||||
var result = await _userManager.CreateAsync(user, password);
|
||||
|
||||
if (result.Succeeded)
|
||||
{
|
||||
TempData["Message"] = "Användare skapad!";
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
foreach (var error in result.Errors)
|
||||
{
|
||||
ModelState.AddModelError("", error.Description);
|
||||
}
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> AddToRole(string userId, string role)
|
||||
|
||||
Reference in New Issue
Block a user