admin user
This commit is contained in:
@@ -15,9 +15,9 @@ namespace Webshop.Api.Controllers.Admin
|
||||
[Authorize(Roles = "Admin")]
|
||||
public class AdminUsersController : ControllerBase
|
||||
{
|
||||
private readonly AdminUserService _adminUserService;
|
||||
private readonly IAdminUserService _adminUserService;
|
||||
|
||||
public AdminUsersController(AdminUserService adminUserService)
|
||||
public AdminUsersController(IAdminUserService adminUserService)
|
||||
{
|
||||
_adminUserService = adminUserService;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ using Microsoft.AspNetCore.HttpOverrides; // For UseForwardedHeaders
|
||||
using Microsoft.Extensions.Logging; // For ILogger
|
||||
using Microsoft.OpenApi.Models; // For Swagger OpenAPI models
|
||||
using Webshop.Api.SwaggerFilters; // For AuthorizeOperationFilter
|
||||
using Webshop.Domain.Entities;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -24,9 +25,12 @@ builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
||||
);
|
||||
|
||||
// 2. ASP.NET Core Identity f<>r Benutzerverwaltung registrieren
|
||||
builder.Services.AddIdentity<IdentityUser, IdentityRole>()
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>()
|
||||
.AddDefaultTokenProviders();
|
||||
builder.Services.AddIdentity<ApplicationUser, IdentityRole>(options =>
|
||||
{
|
||||
options.SignIn.RequireConfirmedAccount = true;
|
||||
})
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>() // Stellen Sie sicher, dass Ihr DbContext-Name hier korrekt ist
|
||||
.AddDefaultTokenProviders();
|
||||
|
||||
// Optional: Passe die Anforderungen f<>r Passw<73>rter f<>r die Entwicklung an
|
||||
builder.Services.Configure<IdentityOptions>(options =>
|
||||
|
||||
Reference in New Issue
Block a user