Skip to content

Fix copy button missing for newly created API key#545

Merged
neoneye merged 1 commit intomainfrom
fix/account-copy-button
Apr 9, 2026
Merged

Fix copy button missing for newly created API key#545
neoneye merged 1 commit intomainfrom
fix/account-copy-button

Conversation

@neoneye
Copy link
Copy Markdown
Member

@neoneye neoneye commented Apr 9, 2026

Summary

  • The copy-to-clipboard button was missing for the top row in the API keys table on the /account page
  • When api_key_show_once is enabled, key_plaintext is None in the DB, so the {% if key.key_plaintext %} check skipped the button
  • Now falls back to new_api_key (from session flash) when the key prefix matches, so the copy button appears on the first render after creation

Test plan

  • Create a new API key, verify copy button appears in both the flash banner and the table row
  • Refresh page, verify the copy button disappears (show-once behavior preserved)
  • Other rows with key_plaintext still show their copy buttons

🤖 Generated with Claude Code

When api_key_show_once is enabled, the top row was missing its copy
button because key_plaintext is None. Now falls back to new_api_key
when the key prefix matches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@neoneye neoneye merged commit b4d8ec6 into main Apr 9, 2026
3 checks passed
@neoneye neoneye deleted the fix/account-copy-button branch April 9, 2026 23:35
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