diff --git a/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor b/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor index f13a612..44df8b0 100644 --- a/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor +++ b/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor @@ -8,44 +8,54 @@ Create Client

Create Client

-@if (_isLoading) -{ - // is loading -

Loading data...

-} -else -{ -
-
- -
-
- -
-
- @_errorMessage -
-
-
- - Cancel - - + +
+ +
+
+ @_errorMessage +
+
+
+ + Cancel + +
- -} \ No newline at end of file +
+ + \ No newline at end of file diff --git a/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor.cs b/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor.cs index 26e27a5..ee5cff3 100644 --- a/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor.cs +++ b/OryAdmin/Components/Pages/OAuth2/Clients/Create.razor.cs @@ -8,28 +8,25 @@ namespace OryAdmin.Components.Pages.OAuth2.Clients; public partial class Create { private readonly HydraOAuth2Client _client = new(); + private HydraOAuth2Client? _createdClient; private string? _errorMessage; - private bool _isLoading = true; [Inject] private ApiService ApiService { get; set; } = default!; - protected override async Task OnInitializedAsync() - { - _isLoading = false; - } - private async Task SubmitForm() { try { - _ = await ApiService.HydraOAuth2.CreateOAuth2ClientAsync(_client); + _createdClient = await ApiService.HydraOAuth2.CreateOAuth2ClientAsync(_client); } catch (ApiException exception) { _errorMessage = exception.Message; - return; } + } + private void GotoIndexPage() + { Navigation.NavigateTo("oauth2/clients"); } } \ No newline at end of file diff --git a/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor b/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor index 6000aa0..b7ad300 100644 --- a/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor +++ b/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor @@ -22,16 +22,7 @@ else Client Name
-
- -
-
-
diff --git a/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor.cs b/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor.cs index 717b431..d4ce19c 100644 --- a/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor.cs +++ b/OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor.cs @@ -14,8 +14,6 @@ public partial class Edit [Parameter] public required string ClientId { get; set; } - private readonly List _patches = new(); - [Inject] private ApiService ApiService { get; set; } = default!; protected override async Task OnInitializedAsync() @@ -28,7 +26,7 @@ private async Task SubmitForm() { try { - _ = await ApiService.HydraOAuth2.PatchOAuth2ClientAsync(ClientId, _patches); + _ = await ApiService.HydraOAuth2.SetOAuth2ClientAsync(ClientId, _client); } catch (ApiException exception) { @@ -38,9 +36,4 @@ private async Task SubmitForm() Navigation.NavigateTo("oauth2/clients"); } - - private void AddPatch(HydraJsonPatch patch) - { - _patches.Add(patch); - } } \ No newline at end of file diff --git a/OryAdmin/Components/Pages/OAuth2/Clients/View.razor b/OryAdmin/Components/Pages/OAuth2/Clients/View.razor index 5912b44..7510a64 100644 --- a/OryAdmin/Components/Pages/OAuth2/Clients/View.razor +++ b/OryAdmin/Components/Pages/OAuth2/Clients/View.razor @@ -29,7 +29,7 @@ else Client Secret - @(string.IsNullOrWhiteSpace(_client.ClientSecret) ? "-" : _client.ClientSecret) + ************************** Client Secret Expires At @@ -61,12 +61,16 @@ else Edit Client +
- + +

Consent screen

diff --git a/OryAdmin/Components/Pages/OAuth2/Clients/View.razor.cs b/OryAdmin/Components/Pages/OAuth2/Clients/View.razor.cs index 819e75c..36595b5 100644 --- a/OryAdmin/Components/Pages/OAuth2/Clients/View.razor.cs +++ b/OryAdmin/Components/Pages/OAuth2/Clients/View.razor.cs @@ -8,7 +8,9 @@ public partial class View { private HydraOAuth2Client? _client; private bool _isLoading = true; - private bool _showDeleteModal; + private bool _confirmDeleteClientModal; + private bool _confirmNewSecretModal; + private bool _showNewSecretModal; [Parameter] public string? ClientId { get; set; } [Inject] private ApiService ApiService { get; set; } = default!; @@ -31,11 +33,18 @@ private async Task DeleteClient() private void ShowDeleteModal() { - _showDeleteModal = true; + _confirmDeleteClientModal = true; } private void HideDeleteModal() { - _showDeleteModal = false; + _confirmDeleteClientModal = false; + } + + private async Task CreateNewClientSecret() + { + _confirmNewSecretModal = false; + // TODO generate new client secret + _showNewSecretModal = true; } } \ No newline at end of file