From e5fb13632f03cd81c308bee1c2df18710392a12c Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Fri, 24 Jul 2026 17:55:23 +0000 Subject: [PATCH] fix(auth): configure Identity cookie paths to use custom login page Add ConfigureApplicationCookie to override Identity default paths (/Account/Login) with custom paths (/login). This fixes the 404 error when unauthenticated users are redirected to the login page. --- src/Heimdall.Infrastructure/DependencyInjection.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Heimdall.Infrastructure/DependencyInjection.cs b/src/Heimdall.Infrastructure/DependencyInjection.cs index 211ff36..5c2957e 100644 --- a/src/Heimdall.Infrastructure/DependencyInjection.cs +++ b/src/Heimdall.Infrastructure/DependencyInjection.cs @@ -55,6 +55,14 @@ public static class DependencyInjection .AddEntityFrameworkStores() .AddDefaultTokenProviders(); + // Configure Identity cookie paths to use custom login page instead of default /Account/Login + services.ConfigureApplicationCookie(options => + { + options.LoginPath = "/login"; + options.LogoutPath = "/_auth/signout"; + options.AccessDeniedPath = "/not-found"; + }); + // Data Protection (for camera credential encryption) var dpMode = configuration.GetValue("DataProtection:Mode") ?? "Persisted"; if (dpMode == "Ephemeral")