summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index 22bf80e..0bcd2cb 100644
--- a/Program.cs
+++ b/Program.cs
@@ -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 => {