summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Program.cs b/Program.cs
index d8aa5c6..cda77d3 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using System.Text.Json.Serialization;
using HyperBooru.Services;
+using Microsoft.AspNetCore.Authentication.Cookies;
namespace HyperBooru;
@@ -9,6 +10,8 @@ public class Program {
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthentication().AddCookie();
builder.Services.AddHttpContextAccessor();
+ builder.Services.AddAuthentication(
+ CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();
builder.Services.AddControllers().AddJsonOptions(o => {
var converter = new JsonStringEnumConverter();
o.JsonSerializerOptions.Converters.Add(converter);
@@ -22,7 +25,6 @@ public class Program {
builder.Services.AddScoped<ISearchService, SearchService>();
builder.Services.AddScoped<ITagService, TagService>();
builder.Services.AddScoped<IMediaService, MediaService>();
- builder.Services.AddSingleton<IGlobalUserService, GlobalUserService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddHostedService<OcrService>();