backend complete

This commit is contained in:
2025-05-17 13:48:10 -04:00
parent 3ac1fbcd8e
commit bb740cbefc
12 changed files with 173 additions and 34 deletions

View File

@@ -68,6 +68,12 @@ builder.Services.AddAuthentication(options =>
{
if (string.IsNullOrWhiteSpace(ctx.Token))
ctx.Token = ctx.Request.Headers.Authorization.FirstOrDefault()?.Replace("Bearer ", "");
#if DEBUG //allow cookie based auth when in debug mode
if(string.IsNullOrWhiteSpace(ctx.Token))
ctx.Token = ctx.Request.Cookies.FirstOrDefault(c => c.Key == "token").Value;
#endif
return Task.CompletedTask;
},
OnAuthenticationFailed = ctx =>