Skip to content

Commit fc5c10d

Browse files
committed
fix: use explicit auth pattern
This was seemingly putting the stylesheets behind auth when deployed?
1 parent 0d0a793 commit fc5c10d

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

WebApi/Controllers/LinkController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using ApplicationData.Locale;
22
using ApplicationData.Services;
33
using DataClasses;
4+
using Microsoft.AspNetCore.Authorization;
45
using Microsoft.AspNetCore.Mvc;
56
using Newtonsoft.Json;
67
using SnooBrowser.Browsers;
@@ -16,6 +17,7 @@ namespace WebApi.Controllers;
1617
/// </summary>
1718
[ApiController]
1819
[Route("v1/[controller]")]
20+
[Authorize]
1921
public class LinkController : Controller
2022
{
2123
private readonly LinkProvider _linkProvider;

WebApi/Controllers/MeController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ApplicationData.Services;
2+
using Microsoft.AspNetCore.Authorization;
23
using Microsoft.AspNetCore.Mvc;
34
using WebApi.Models;
45
using WebApi.Util;
@@ -10,6 +11,7 @@ namespace WebApi.Controllers;
1011
/// </summary>
1112
[ApiController]
1213
[Route("v1/[controller]")]
14+
[Authorize]
1315
public class MeController : Controller
1416
{
1517
private readonly UserProvider _userProvider;

WebApi/Program.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ static void ConfigureServices(IServiceCollection services, IConfiguration config
136136
{
137137
opts.AddScheme<ApiKeyAuthHandler>("ApiKey", displayName: null);
138138
});
139-
services.AddAuthorizationBuilder()
140-
.SetFallbackPolicy(new AuthorizationPolicyBuilder()
141-
.RequireAuthenticatedUser()
142-
.Build());
139+
services.AddAuthorization();
143140

144141
var hostingOptions = configuration.GetSection("Hosting").Get<HostingOptions>();
145142

0 commit comments

Comments
 (0)