summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-09-14 12:00:20 +1000
committerJake Mannens <jake@asger.xyz>2023-09-14 12:00:20 +1000
commit3a23cbe192040f55c54cb3bb572d531e6a07a2dd (patch)
tree385a035257ca70b2689f442d6ea1d158cc8a7161 /Program.cs
parente6e43b943143d55581ef442b61ed6cbdbb40c642 (diff)
Finished initial implementation of login page
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 01b7949..e78f0d4 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;
@@ -8,6 +9,8 @@ public class Program {
public static void Main(string[] args) {
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpContextAccessor();
+ builder.Services.AddAuthentication(
+ CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();
builder.Services.AddControllers().AddJsonOptions(o => {
var converter = new JsonStringEnumConverter();
o.JsonSerializerOptions.Converters.Add(converter);
@@ -21,7 +24,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>();