Increment View count

misc fixes
This commit is contained in:
2025-04-15 23:07:54 -04:00
parent 1c9127ca19
commit d3a139feb5
5 changed files with 18 additions and 31 deletions

View File

@@ -42,9 +42,7 @@ builder.Services.AddAuthentication(options =>
OnMessageReceived = ctx => //Retreive token from cookie if not found in headers
{
if (string.IsNullOrWhiteSpace(ctx.Token))
ctx.Token = ctx.Request.Cookies["token"];
if (string.IsNullOrWhiteSpace(ctx.Token))
ctx.Token = ctx.Request.Headers["Authorization"].FirstOrDefault()?.Replace("Bearer ", "");
ctx.Token = ctx.Request.Headers.Authorization.FirstOrDefault()?.Replace("Bearer ", "");
return Task.CompletedTask;
},
OnAuthenticationFailed = ctx =>
@@ -59,7 +57,7 @@ builder.Services.AddAuthentication(options =>
return Task.CompletedTask;
}
};
}).AddScheme<AuthenticationSchemeOptions, AobaAuthenticationHandler>("Aoba", cfg => { });
}).AddScheme<AuthenticationSchemeOptions, AobaAuthenticationHandler>("Aoba", null);
builder.Services.AddAoba();
builder.Services.Configure<FormOptions>(opt =>