Skip to content

Commit 9ac1b8e

Browse files
committed
Added controllers and auth loading.
1 parent 664c7e3 commit 9ac1b8e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

DisBot.API/Startup/Startup.Auth.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ public static partial class Startup
55
private static async Task InitialiseAuth(this WebApplicationBuilder builder)
66
{
77
builder.Services.AddAuthentication();
8+
builder.Services.AddAuthorization();
89
}
910

10-
private static async Task LoadAuth(this WebApplication host)
11+
private static async Task LoadAuth(this WebApplication application)
1112
{
13+
application.UseAuthentication();
14+
application.UseAuthorization();
1215
}
1316
}

DisBot.API/Startup/Startup.Base.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public partial class Startup
88
private static async Task InitialiseBase(this WebApplicationBuilder builder)
99
{
1010
builder.Services.AddControllers();
11-
1211
builder.Services.AddOptions<DatabaseOptions>().BindConfiguration("Database");
1312
builder.Services.AddOptions<OAuth2Options>().BindConfiguration("OAuth2");
1413
builder.Services.AddOptions<SessionOptions>().BindConfiguration("Session");
@@ -18,5 +17,7 @@ private static async Task InitialiseBase(this WebApplicationBuilder builder)
1817
private static async Task LoadBase(this WebApplication application)
1918
{
2019
application.MapOpenApi();
20+
application.MapControllers();
21+
2122
}
2223
}

0 commit comments

Comments
 (0)