Auth System

This commit is contained in:
Andre Beging
2022-04-04 10:04:19 +02:00
parent 77382944eb
commit 427b924759
14 changed files with 552 additions and 16 deletions

View File

@@ -1,8 +1,11 @@
using Blazorise;
using Blazorise.Icons.Material;
using Blazorise.Material;
using FoodsharingSiegen.Server.Auth;
using FoodsharingSiegen.Server.Data;
using FoodsharingSiegen.Server.Data.Service;
using FoodsharingSiegen.Server.Service;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
@@ -15,7 +18,11 @@ builder.Services.AddDbContextFactory<FsContext>(opt =>
opt.UseSqlite($"Data Source=app.db"));
// DI
builder.Services.AddScoped<LocalStorageService>();
builder.Services.AddScoped<AuthenticationStateProvider, TokenAuthStateProvider>();
builder.Services.AddScoped<FsContext>();
builder.Services.AddScoped<AuthService>();
builder.Services.AddScoped<UserService>();
builder.Services.AddScoped<ProspectService>();