From 403f2b7cb6f95b7d75f9d681add18fdd2c4dbdce Mon Sep 17 00:00:00 2001 From: Jay Malhotra <5047192+SapiensAnatis@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:57:57 +0100 Subject: [PATCH] Add diagnostics for issues with auth when ssr request (#916) --- DragaliaAPI/DragaliaAPI/Program.cs | 2 +- Website/src/routes/(main)/account/+layout.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DragaliaAPI/DragaliaAPI/Program.cs b/DragaliaAPI/DragaliaAPI/Program.cs index d45554666..1165671d2 100644 --- a/DragaliaAPI/DragaliaAPI/Program.cs +++ b/DragaliaAPI/DragaliaAPI/Program.cs @@ -191,11 +191,11 @@ cors.WithOrigins(allowedOrigins).AllowCredentials().AllowAnyHeader().AllowAnyMethod() ); applicationBuilder.UseRouting(); + applicationBuilder.UseSerilogRequestLogging(); #pragma warning disable ASP0001 applicationBuilder.UseAuthorization(); #pragma warning restore ASP0001 applicationBuilder.UseMiddleware(); - applicationBuilder.UseSerilogRequestLogging(); applicationBuilder.UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/Website/src/routes/(main)/account/+layout.ts b/Website/src/routes/(main)/account/+layout.ts index 9c5951dcc..60dcf62bc 100644 --- a/Website/src/routes/(main)/account/+layout.ts +++ b/Website/src/routes/(main)/account/+layout.ts @@ -11,6 +11,7 @@ export const load: LayoutLoad = async ({ fetch, url }) => { if (!response.ok) { if (response.status >= 400 && response.status <= 499) { + console.log(`/user/me response was not successful: ${response.status}`); redirect(303, `/unauthorized/${response.status}`); } else { throw new Error(`/user/me error: HTTP ${response.status}`);