diff options
Diffstat (limited to 'Program.cs')
-rw-r--r-- | Program.cs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -7,6 +7,7 @@ using System.Text.Json.Serialization; using System.Text; using Microsoft.EntityFrameworkCore; using BackendPIA.Models; +using BackendPIA.Services; var builder = WebApplication.CreateBuilder(args); @@ -20,6 +21,10 @@ builder.Services.AddIdentity<UserAccount, IdentityRole>().AddEntityFrameworkStor // Automapper configuration. builder.Services.AddAutoMapper(typeof(Program)); +// Custom services configuration. +builder.Services.AddSingleton<ITokenGenerator>(s => new TokenGenerator(builder.Configuration["Jwt:Key"])); +// End of custom services configuration. + // Swagger configuration. builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(c => { |