Commit a4a1dc9
authored
fixes #15529
## What
Fixes the copy behavior in the "Secret key created" dialog for secret API keys.
## Why
Copy could report success even when clipboard write failed (or when token was missing), causing users to paste incorrect content.
## How
- Added early return when `createdKey.token` is missing.
- Wrapped clipboard write in `try/catch`.
- Added secure-context and clipboard availability checks.
- Show success toast only on successful copy, failure toast on errors.
## Testing
- Created a secret key in Admin.
- Clicked `Copy API Key` and verified token is copied.
- Verified failure toast appears when clipboard API is unavailable.
closes #15529
1 parent 68f7a0e commit a4a1dc9
2 files changed
Lines changed: 21 additions & 5 deletions
File tree
- .changeset
- packages/admin/dashboard/src/routes/api-key-management/api-key-management-create/components/api-key-create-form
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | | - | |
87 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
88 | 97 | | |
89 | 98 | | |
90 | 99 | | |
| |||
188 | 197 | | |
189 | 198 | | |
190 | 199 | | |
191 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
| |||
0 commit comments