diff --git a/API/Controllers/AuthController.cs b/API/Controllers/AuthController.cs new file mode 100644 index 0000000..fea2dea --- /dev/null +++ b/API/Controllers/AuthController.cs @@ -0,0 +1,10 @@ +using Microsoft.AspNetCore.Mvc; + +namespace API.Controllers; + +[ApiController] +[Route("api/account")] +public class AuthController : ControllerBase +{ + +} diff --git a/API/Program.cs b/API/Program.cs index 2110c32..f15c0a9 100644 --- a/API/Program.cs +++ b/API/Program.cs @@ -1,7 +1,9 @@ using API.Database; using API.Models.Internal.User; using API.Repository.AgeGroup; +using API.Services; using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.EntityFrameworkCore; var webRoot = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", "wwwroot")); @@ -21,9 +23,12 @@ builder.Services.AddAuthorization(); builder.Services.AddAuthentication() .AddCookie(IdentityConstants.ApplicationScheme); -builder.Services.AddIdentityCore() - .AddEntityFrameworkStores() - .AddApiEndpoints(); +builder.Services.AddIdentityCore(options => +{ + options.SignIn.RequireConfirmedAccount = true; + options.User.RequireUniqueEmail = true; +}).AddEntityFrameworkStores().AddDefaultTokenProviders(); + // Database var postgresConnection = builder.Configuration.GetConnectionString("PostgresConnection"); @@ -37,6 +42,9 @@ else builder.Services.AddDbContext(options => options.UseSqlite("Data Source=app.db")); } +// Adding Email Service (Plunk) +builder.Services.AddHttpClient(); + // Adding Database Services builder.Services.AddScoped();