поправил настройки для роли

parent 355dfcbe
...@@ -103,7 +103,7 @@ public class AccountsController : Controller ...@@ -103,7 +103,7 @@ public class AccountsController : Controller
var claims = new List<Claim> var claims = new List<Claim>
{ {
new Claim(ClaimsIdentity.DefaultNameClaimType, user.Email), new Claim(ClaimsIdentity.DefaultNameClaimType, user.Email),
new Claim(ClaimsIdentity.DefaultNameClaimType, user.Role?.Name) new Claim(ClaimsIdentity.DefaultRoleClaimType, user.Role?.Name)
}; };
ClaimsIdentity id = new ClaimsIdentity( ClaimsIdentity id = new ClaimsIdentity(
claims, claims,
......
...@@ -20,7 +20,7 @@ public class HomeController : Controller ...@@ -20,7 +20,7 @@ public class HomeController : Controller
return View(); return View();
} }
[Authorize(Roles = "admin, user")] [Authorize(Roles = "admin")]
public IActionResult Privacy() public IActionResult Privacy()
{ {
return View(); return View();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment