fix(cli): ensure first user created via CLI is admin#6155
Conversation
|
Claude finished @geovannewashington's task in 5m 53s —— View job Code Review CompleteReviewed 1 file. 1 inline issue posted (1 critical). The production code logic ( Summary of test breakageThe
See the inline comment for detailed fix instructions. If you've addressed the feedback and want a new review, tag |
b1c801c to
6659e25
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 3m 5s —— View job Code Review CompleteReviewed 2 files. 1 inline issue posted (1 critical). The production code logic ( If you've addressed the feedback and want a new review, tag |
6659e25 to
29d2c85
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 2m 0s —— View job Code Review CompleteReviewed 2 files. 1 inline issue posted (1 critical). The production code logic ( However, the If you've addressed the feedback and want a new review, tag |
Ensure the first user created via CLI is automatically promoted to admin, matching the behavior of the API setup endpoint. Previously, admin privileges were only assigned when the --admin flag was explicitly provided, which caused an inconsistency between CLI and API flows. This change checks the system setup state before user creation and forces admin privileges when the system is not yet initialized. The logic is implemented in the service layer to guarantee consistent behavior across all entry points.
29d2c85 to
be6cc41
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 3m 3s —— View job Code Review CompleteReviewed 2 files across code quality, security, testing, language patterns, and architecture — no issues found. The code looks good as-is. The production code logic (
If you push additional changes and want a new review, tag |
What changed
The CLI now ensures that the first user created is automatically granted admin privileges, even when the --admin flag is not used.
Why
Previously, admin privileges were only assigned when the --admin flag was explicitly provided. This created an inconsistency with the API setup endpoint, which automatically promotes the first user to admin.
This change aligns the CLI behavior with the API and prevents misconfiguration during initial system setup.
How to test
make start./bin/cli user create <username> <password> <email>./bin/cli user listFixes #6153