Summary
The Invite Friends dashboard copy button calls navigator.clipboard.writeText directly. In insecure contexts, embedded browsers, denied permissions, or browser privacy modes where the Clipboard API is missing or rejects writes, clicking Copy throws and the user gets no useful fallback.
Steps to reproduce
- Open
/dashboard/referrals in a context where Clipboard API writes are unavailable or denied.
- Click the Copy button beside the referral link.
Expected
The page should still attempt a DOM copy fallback or show a clear manual-copy message.
Actual
The direct navigator.clipboard.writeText call can reject/throw and the Invite Friends copy flow fails.
Proposed fix
Wrap Clipboard API usage, fall back to a temporary textarea + document.execCommand("copy"), and show a manual-copy error if both paths fail.
Summary
The Invite Friends dashboard copy button calls
navigator.clipboard.writeTextdirectly. In insecure contexts, embedded browsers, denied permissions, or browser privacy modes where the Clipboard API is missing or rejects writes, clicking Copy throws and the user gets no useful fallback.Steps to reproduce
/dashboard/referralsin a context where Clipboard API writes are unavailable or denied.Expected
The page should still attempt a DOM copy fallback or show a clear manual-copy message.
Actual
The direct
navigator.clipboard.writeTextcall can reject/throw and the Invite Friends copy flow fails.Proposed fix
Wrap Clipboard API usage, fall back to a temporary textarea +
document.execCommand("copy"), and show a manual-copy error if both paths fail.