From 6467e03e29297146fc2feaeb84106b74c1709906 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 10 Apr 2023 18:45:27 +0200 Subject: [PATCH] fix: switch to ws-fed crash app --- .../Components/ClientUrisPanel.razor | 50 +++++++++---------- .../Components/ClientUrisPanel.razor.cs | 32 ++++++++---- 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor index 1f486e852..d99738a15 100644 --- a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor @@ -1,32 +1,32 @@ @inject IStringLocalizerAsync Localizer
-@if(Model.ProtocolType != "wsfed") -{ -
- -
-
- -
-} -else -{ -
-
-
- URL + @if (Model.ProtocolType != "wsfed") + { +
+ +
+
+ +
+ } + else + { +
+
+
+ URL +
-
-
-
- -
- +
+
+ +
+ +
-
-} + }
diff --git a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor.cs b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor.cs index 0367fe381..fced8bfb8 100644 --- a/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor.cs +++ b/src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientUrisPanel.razor.cs @@ -9,6 +9,29 @@ namespace Aguacongas.TheIdServer.BlazorApp.Pages.Client.Components { public partial class ClientUrisPanel { + string WsFedRedirectUri + { + get => Model.RedirectUris.FirstOrDefault()?.Uri; + set + { + var uri = Model.RedirectUris.FirstOrDefault(); + if (uri is null) + { + uri = new Entity.ClientUri + { + Kind = Entity.UriKinds.Redirect, + Uri = value + }; + Model.RedirectUris.Add(uri); + HandleModificationState.EntityCreated(uri); + return; + } + + uri.Uri = value; + HandleModificationState.EntityUpdated(uri); + } + } + [Parameter] public Entity.Client Model { get; set; } @@ -18,15 +41,6 @@ public partial class ClientUrisPanel protected override void OnInitialized() { HandleModificationState.OnStateChange += HandleModificationState_OnStateChange; - if (Model.ProtocolType == "wsfed" && !Model.RedirectUris.Any()) - { - var uri = new Entity.ClientUri - { - Kind = Entity.UriKinds.Redirect - }; - Model.RedirectUris.Add(uri); - HandleModificationState.EntityCreated(uri); - } } private void HandleModificationState_OnStateChange(ModificationKind kind, object entity)