Skip to content

fix(dashboard): copy API keys on insecure contexts - #984

Merged
T3ST3ST3R0N merged 1 commit into
devfrom
fix/api-key-copy-insecure-context
Oct 10, 2026
Merged

T3ST3ST3R0N merged 1 commit into
devfrom
fix/api-key-copy-insecure-context

Conversation

@T3ST3ST3R0N

Copy link
Copy Markdown
Collaborator

Follow-up to #907 (#890).

The API key creation dialog and the reissue dialog still called navigator.clipboard.writeText directly. On plain HTTP navigator.clipboard is undefined, so the copy button threw and copied nothing; on HTTPS the success toast did not wait for the write.

Both now use the shared useClipboard hook with its insecure-context fallbacks, and show the usual "copy failed" toast when copying fails, like the user action menu. No direct navigator.clipboard calls remain outside the hook.

Checked: tsc --noEmit reports nothing new compared with dev, and vite build passes.

The API key creation dialog and the reissue dialog called
navigator.clipboard.writeText directly. On plain HTTP navigator.clipboard
is undefined, so the copy button threw and copied nothing; on HTTPS the
success toast did not wait for the write.

Use the shared useClipboard hook (which has the insecure-context
fallbacks from #907) in both places, and show the usual "copy failed"
toast when copying fails.
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 893c1987-f077-45a5-a2d8-28b03ce3f545

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@T3ST3ST3R0N
T3ST3ST3R0N merged commit 80d9501 into dev Oct 10, 2026
7 checks passed
@T3ST3ST3R0N
T3ST3ST3R0N deleted the fix/api-key-copy-insecure-context branch October 22, 2026 12:34
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
…ain bba95f274

Checked with git ls-remote on 2026-10-11 02:55 UTC. Panel dev moved from
d94e157 to 83fe90e with 22 commits; main is still v5.4.1.

- PasarGuard#879 (2d0ca81, loopback Xray client inbounds) is ported by design: the
  fork took the open pull request on 2026-09-25 as 2e7fc45 with migration
  bfd88026565b, the same listener rewrite.
- PasarGuard#934 (a5b28f3) moves from the port queue to a dated waiver until
  2026-11-09: the fork refuses to delete a core that nodes still use
  (W3-013, fix/node-health) instead of restarting those nodes.
- PasarGuard#993 (Hysteria2 FinalMask without a udp mask) is queued until 2026-10-18:
  the fork has the same FinalMask | dict field and the same non-null-safe
  udpHop reads, so a udpHop-only host can fail the whole subscription.
- PasarGuard#984, PasarGuard#985, PasarGuard#986, PasarGuard#989, PasarGuard#944, PasarGuard#864, PasarGuard#948, PasarGuard#951, PasarGuard#778, PasarGuard#774, PasarGuard#787, PasarGuard#994,
  PasarGuard#865, PasarGuard#875, PasarGuard#718, PasarGuard#967, PasarGuard#772, PasarGuard#662, PasarGuard#995 and PasarGuard#913 are queued as
  security: no until 2026-10-25, each with its reason; PasarGuard#913's node-removal
  half is already in the fork through sync_remove_users.
- The branch commits that upstream squash-merged (the three dashboard
  branches, telegram/tests, fix/core-editor-api-section-followup,
  fix/hwid-count-test-cleanup, fix/hysteria-finalmask-quic-only) follow
  their squash, by patch-id or by an equal tree.

Scripts main moved to bba95f274 (PasarGuard#35, PasarGuard#36, PasarGuard#37 after PasarGuard#34). The three
squashes are queued security: no until 2026-10-25, and their pre-squash
branch commits are waived as superseded (equal trees).

Against live upstream the panel gate now fails only on the 17 port-queue
commits classified security: yes, and the forks gate only on node
f72ac0ef (security: yes). No upstream commit is undecided.
Free-Guy-IR pushed a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
The API key creation dialog and the reissue dialog called
navigator.clipboard.writeText directly. On plain HTTP navigator.clipboard
is undefined, so the copy button threw and copied nothing; on HTTPS the
success toast did not wait for the write.

Use the shared useClipboard hook (which has the insecure-context
fallbacks from PasarGuard#907) in both places, and show the usual "copy failed"
toast when copying fails.

(cherry picked from commit 80d9501)
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