Skip to content

refactor: shared AuthMethodFields component#54

Merged
matthiastjong merged 1 commit intomainfrom
refactor/shared-auth-method-fields
Apr 9, 2026
Merged

refactor: shared AuthMethodFields component#54
matthiastjong merged 1 commit intomainfrom
refactor/shared-auth-method-fields

Conversation

@matthiastjong
Copy link
Copy Markdown
Owner

@matthiastjong matthiastjong commented Apr 9, 2026

Summary

  • Extract auth method form fields into a shared AuthMethodFields component (src/lib/components/auth-method-fields.svelte)
  • Fix missing JWT ES256 and OAuth2 Refresh Token options in the target create flow
  • Fix custom_header auth using old single-header format in create flow — now uses multi-header support from PR feat: support multi-header custom auth #53
  • Update targets list page server action to handle all auth types consistently with the target detail page

What changed

  • New: src/lib/components/auth-method-fields.svelte — shared component with all auth type options and credential fields
  • Modified: src/routes/(app)/targets/+page.svelte — replaced ~130 lines of inline auth fields with shared component
  • Modified: src/routes/(app)/targets/[slug]/+page.svelte — replaced ~440 lines of duplicated auth fields (add + edit) with shared component
  • Modified: src/routes/(app)/targets/+page.server.ts — added handling for custom_header (multi-header JSON), jwt_es256, and oauth2_refresh_token types

Test plan

  • Create a new API target and verify all 6 auth types are available (Bearer, Basic, Custom Header, Query Param, JWT ES256, OAuth2 Refresh Token)
  • Add a custom_header auth method with multiple headers during target creation
  • Edit an existing target and verify auth method add/edit still works with all types
  • Verify SSH targets still show only SSH Key option

🤖 Generated with Claude Code

Unify auth method form fields into a single shared component used by both
the target create flow and target detail page. This fixes the create dialog
missing JWT ES256 and OAuth2 Refresh Token options, and adds multi-header
support for custom_header auth in the create flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matthiastjong matthiastjong merged commit e044495 into main Apr 9, 2026
3 checks passed
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.

1 participant