feat: add token management to setup wizards#146
Merged
Conversation
Add auth token configuration to CLI and web wizards so users can generate and view tokens during initial setup instead of relying on manual commands.
Comment on lines
+67
to
+73
| if (workspacesError && error) { | ||
| const errorMessage = (error as Error).message || ''; | ||
| if (errorMessage.includes('401') || errorMessage.includes('Unauthorized')) { | ||
| setNeedsAuth(true); | ||
| return; | ||
| } | ||
| } |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
- Use Promise.all for parallel save operations in Setup wizard - Use functional setState in toggleSSHKey to avoid stale closures - Use timing-safe comparison for token validation to prevent timing attacks
Comment on lines
+38
to
+48
| if (response.ok) { | ||
| onAuthenticated(); | ||
| } else if (response.status === 401) { | ||
| setError('Invalid token'); | ||
| setToken(''); | ||
| } else { | ||
| setError('Connection failed. Please check the agent is running.'); | ||
| } | ||
| } catch { | ||
| setError('Connection failed. Please check the agent is running.'); | ||
| } finally { |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
- Use clearToken() instead of setToken('') for clearer intent
- Remove redundant type annotations where TypeScript infers them
Code-simplifier modifies code, so it should run first. Then reviews validate the simplified result in parallel with validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
perry agent config) - shows existing token or generates new oneconfig.auth.getandconfig.auth.generateAPI endpointsCloses the gap where PR #145 added token auth but neither wizard helped users configure it.
🤖 Generated with Claude Code