Skip to content

feat: add token management to setup wizards#146

Merged
gricha merged 7 commits intomainfrom
feat/token-management-wizards
Jan 24, 2026
Merged

feat: add token management to setup wizards#146
gricha merged 7 commits intomainfrom
feat/token-management-wizards

Conversation

@gricha
Copy link
Copy Markdown
Owner

@gricha gricha commented Jan 24, 2026

Summary

  • Add auth token step to CLI TUI wizard (perry agent config) - shows existing token or generates new one
  • Add auth page to web UI - prompts for token when API returns 401
  • Add security step to web setup wizard - shows token status, allows generating new tokens
  • Add config.auth.get and config.auth.generate API endpoints

Closes the gap where PR #145 added token auth but neither wizard helped users configure it.

🤖 Generated with Claude Code

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 thread web/src/App.tsx
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.

- 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 thread web/src/pages/Auth.tsx
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.

- 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.
@gricha gricha merged commit 71418cc into main Jan 24, 2026
8 checks passed
@gricha gricha deleted the feat/token-management-wizards branch January 24, 2026 06:52
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