From 96d1db1008122b0fe3f178e20531d46b7a39366f Mon Sep 17 00:00:00 2001 From: thepra Date: Sat, 3 Oct 2026 12:43:07 +0200 Subject: [PATCH] Fix logout, the client log store and empty name attributes Logout: - It navigated to "authenticatio/logout", a misspelled route. - The correct template route, authentication/logout, would throw anyway. Its RemoteAuthenticatorView casts the AuthenticationStateProvider to the OIDC template's service, and the app registers TokenAuthStateProvider instead. - It now signs out through TokenAuthStateProvider.LogoutAsync, as the code commented out in the page intended, and returns home. LoginDisplay's sign-out goes through it as well. - This also drops the obsolete SignOutSessionStateManager, the build's last warning. The IndexedDB schema never declared the ClientLogs store that IStorage.AddLog writes to, so every client log write failed inside its try/catch. Version 2 adds the store, keyed by the Id AddLog assigns. DInputBase.NameAttribute renders no name instead of name="" when the form maps no field names. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw --- Components/Daisy/DInputBase.cs | 6 ++++++ Components/Daisy/DataInput/DInput.razor | 4 ++-- Components/Daisy/DataInput/DOtp.razor | 2 +- Components/Daisy/DataInput/DRange.razor | 2 +- Components/Daisy/DataInput/DSelect.razor | 4 ++-- Components/Daisy/DataInput/DTextarea.razor | 2 +- Components/Daisy/DataInput/DToggle.razor | 2 +- Extensions/GenericExtensions.cs | 9 ++++++++- Pages/Logout.razor | 11 ++++++----- Shared/LoginDisplay.razor | 2 +- 10 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Components/Daisy/DInputBase.cs b/Components/Daisy/DInputBase.cs index 70604be..25384c0 100644 --- a/Components/Daisy/DInputBase.cs +++ b/Components/Daisy/DInputBase.cs @@ -20,6 +20,12 @@ public abstract class DInputBase : InputBase protected IReadOnlyDictionary InputAttributes => AdditionalAttributes?.Where(a => a.Key != "class").ToDictionary(a => a.Key, a => a.Value); + /// + /// The name attribute, or null so none is rendered. InputBase.NameAttributeValue is "" outside a form that maps + /// field names, which would group every radio and checkbox on the page. + /// + protected string NameAttribute => string.IsNullOrEmpty(NameAttributeValue) ? null : NameAttributeValue; + protected static string Cx(params string[] classes) => DCx.Join(classes); protected override string FormatValueAsString(TValue value) => diff --git a/Components/Daisy/DataInput/DInput.razor b/Components/Daisy/DataInput/DInput.razor index 63233bf..232630c 100644 --- a/Components/Daisy/DataInput/DInput.razor +++ b/Components/Daisy/DataInput/DInput.razor @@ -5,14 +5,14 @@ moves to a wrapping diff --git a/Components/Daisy/DataInput/DRange.razor b/Components/Daisy/DataInput/DRange.razor index 8ea0a4c..a04dc00 100644 --- a/Components/Daisy/DataInput/DRange.razor +++ b/Components/Daisy/DataInput/DRange.razor @@ -3,7 +3,7 @@ @* daisyUI Range: https://daisyui.com/components/range/ . TValue is numeric; Min and Max are always rendered, as daisyUI requires. *@ - diff --git a/Components/Daisy/DataInput/DSelect.razor b/Components/Daisy/DataInput/DSelect.razor index b0671a0..5ee8fe4 100644 --- a/Components/Daisy/DataInput/DSelect.razor +++ b/Components/Daisy/DataInput/DSelect.razor @@ -5,7 +5,7 @@ enums bind by name. With Prefix (an icon or a span.label) the select class moves to a wrapping