Skip to content

Fix: display raw token after creation#35

Open
etagwerker wants to merge 1 commit into
mainfrom
fix-display-raw-token-after-create
Open

Fix: display raw token after creation#35
etagwerker wants to merge 1 commit into
mainfrom
fix-display-raw-token-after-create

Conversation

@etagwerker
Copy link
Copy Markdown
Member

Summary

  • The view at app/views/personal_access_tokens/index.html.erb reads flash[:raw_token], but the controller was updated to set @raw_token directly (the earlier change addressed a review comment about not carrying the raw token through the session cookie).
  • The result: after generating a token, the green "Token created. Copy it now" banner appears, but the actual token is never displayed, so it can't be copied.

This swaps the view to read @raw_token, which matches what PersonalAccessTokensController#create already sets.

How to verify

  • Sign in, visit /personal_access_tokens, name a token and click "Generate token"
  • Confirm the banner now shows the raw lib_… token in a code box
  • Refresh the page and confirm the token is gone (still one-time visibility)

🤖 Generated with Claude Code

The earlier review fix moved the raw token off `flash` onto an instance
variable to avoid serializing it into the session cookie, but the view
kept reading `flash[:raw_token]`. As a result the success banner shows
after creation but the actual token never renders, so users can't copy it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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