Skip to content

Add OAuth Client management section to Admin Dashboard#741

Draft
Copilot wants to merge 6 commits into
developfrom
copilot/extebd-admin-dashboard-oauth-client-section
Draft

Add OAuth Client management section to Admin Dashboard#741
Copilot wants to merge 6 commits into
developfrom
copilot/extebd-admin-dashboard-oauth-client-section

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

Backend shipped CRUD endpoints for OAuth client metadata (/api/v1/oauth/clients). This PR wires them into the Admin Dashboard.

Changes

  • API client — Regenerated from upstream swagger to pull in getOAuthClients, postOAuthClient, patchOAuthClient, deleteOAuthClient and associated types, including the new OAuth client URI metadata fields
  • Data modelsrc/data/internal/oauth/OAuthClient.ts maps snake_case API response to internal camelCase type, including tosUri, policyUri, clientUri, and logoUri
  • HooksuseAdminOAuthClients (list query), useCreateOAuthClient, usePatchOAuthClient, useDeleteOAuthClient (mutations with cache invalidation + toast feedback), plus immediate query-cache updates so created/edited/deleted clients show without a refresh
  • UI components
    • AdminOAuthClientsSection — lists clients with edit/delete actions, displays the client logo, renders the additional URI metadata, and avoids the localized createdAt hydration mismatch
    • AdminOAuthClientCreateDialog — RHF+Zod form; surfaces the plaintext client secret once on creation and now captures the full OAuth client URI metadata
    • AdminOAuthClientEditDialog — patch client name, URI metadata, redirect URIs, and scopes
  • Routing & navigation — New /admin/oauth-clients route, sidebar entry (KeyRound icon), overview card with client count
  • i18n — Translations added across all 5 locales (en/de/fr/it/es), including labels and validation for the URI metadata fields
  • Tests — Section component tests, new create/edit dialog tests for the metadata fields, and updated hydration coverage

@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages Bot commented May 30, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
aura-historia-staging fbfb932 Commit Preview URL

Branch Preview URL
May 31 2026, 11:26 AM

- Add internal OAuthClient data model with mapping from API types
- Add useAdminOAuthClients hook for fetching client list
- Add useCreateOAuthClient, usePatchOAuthClient, useDeleteOAuthClient mutation hooks
- Add AdminOAuthClientsSection component with list view
- Add AdminOAuthClientCreateDialog with secret-shown-once notice
- Add AdminOAuthClientEditDialog for updating client metadata
- Add /admin/oauth-clients route
- Update AdminSidebar with OAuth Clients navigation item
- Update AdminOverviewPage with OAuth Clients card and count
- Add translations for all 5 locales (en, de, fr, it, es)
- Add tests for AdminOAuthClientsSection and updated AdminOverviewPage test
Copilot AI changed the title [WIP] Add CRUD functionality for OAuth-Clients in Admin Dashboard Add OAuth Client management section to Admin Dashboard May 30, 2026
Copilot AI requested a review from bruderj15 May 30, 2026 13:46
@bruderj15
Copy link
Copy Markdown
Member

@copilot creating an Oauth-Client through the new admin dashboard shows an error in the UI:

"Etwas ist schiefgelaufen. Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut."

After refreshing, the Client exists and is being shown though.

Browser-Console logs show this:

Uncaught Error: Minified React error #418; visit https://react.dev/errors/418?args[]=text&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Ii https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Li https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Rc https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Fu https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Mu https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
ju https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Au https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
gu https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
ld https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
O https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:2
main-MQtN8H75.js:9:31186
11:17:50.501 Die Ressource unter "https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/manrope-latin-wght-normal-DHIcAJRg.woff2" wurde vorab geladen ("link-preload"), aber nicht innerhalb der ersten Sekunden verwendet. Es wird eine Überprüfung empfohlen, ob alle preload-Attribute korrekt gesetzt sind. admin
11:17:50.501 Die Ressource unter "https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/newsreader-latin-wght-normal-CCVVNp6i.woff2" wurde vorab geladen ("link-preload"), aber nicht innerhalb der ersten Sekunden verwendet. Es wird eine Überprüfung empfohlen, ob alle preload-Attribute korrekt gesetzt sind. admin
11:18:09.665 TypeError: Hy() is null
ex https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:18
rx https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:18
xo https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
mc https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
jc https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Mu https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
ku https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Ou https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
gu https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
ud https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
ad https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
bu https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
bf https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:10
flushSync https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/react-dom-U178GBpj.js:1
j https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
setTimeout handler*j</</< https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
publish https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
publish https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
addToast https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
create https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
success https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/dist-D5wlxxRF.js:1
onSuccess https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/_auth.admin.oauth-clients-DQDYPlPw.js:2
a https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
batch https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/QueryClientProvider-CsuRiPND.js:1
#a https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
onMutationUpdate https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
i https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
i https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
batch https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/QueryClientProvider-CsuRiPND.js:1
#i https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
execute https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
mutate https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
l https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/useMutation-DTpdLiZ0.js:1
u https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/_auth.admin.oauth-clients-DQDYPlPw.js:2
me https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:18
bd https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Td https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
on https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
Td https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:9
fp https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:10
up https://copilot-extebd-admin-dashboard-oauth-a6c8-aura-historia-staging.bitter-frog-5102.workers.dev/assets/main-MQtN8H75.js:10

The minified react error (first error) appears when simply visiting the page - before adding a new oauth client.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot creating an Oauth-Client through the new admin dashboard shows an error in the UI:

"Etwas ist schiefgelaufen. Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es späte...

Addressed in 559aa1d. The OAuth clients page was triggering a React hydration text mismatch on the localized createdAt label, which could cascade into the follow-up create flow error. I added suppressHydrationWarning to that timestamp text and a focused hydration regression test.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
24.4% Coverage on New Code (required ≥ 80%)
14.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@bruderj15
Copy link
Copy Markdown
Member

@copilot the backend added additional fields for oauth-client metadata, see Changelog.

Please fully support these fields in the Admin Dashboard.
Also display the logo.

PS: The hydration bug is still there and creation of clients work backend-side but only show after refresh - I still get an immediate error page after creating new clients in the admin dashboard.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 31, 2026

@copilot the backend added additional fields for oauth-client metadata, see [Changelog](https://github.com/aura-historia/internal-api/blob/master/CHANGELOG.md#2026-05-31---oauth-client-uri-met...

Addressed in fbfb932.

This adds full admin support for tos_uri, policy_uri, client_uri, and logo_uri (regenerated client types, mapping, create/edit forms, list rendering, and tests), displays the logo in the OAuth client list, and switches the localized created-at label to client-only rendering to avoid the hydration mismatch. I also update the OAuth client query cache immediately on create/edit/delete so newly created clients show up without a refresh.

@bruderj15
Copy link
Copy Markdown
Member

@BauZee would you please fix the hydration error?

Upon successful creation of a new oauth client I get an error - hydration I guess according to browser-logs - which is resolved after reloading the page. OAuth Client is then accessible so it's correctly created backend-side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend Admin-Dashboard with OAuth-Client Section

2 participants