Show error on auth reset with no users configured#560
Conversation
Reset on a fresh install shows a rather confusing message: List of users: Select a user to reset the password for [1-0]: When the list is empty, just print an error and quit.
📝 WalkthroughWalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant CMD as authResetCmd.Run
participant USERS as getUsers()
CMD ->> USERS: Retrieve list of users
alt Users list is empty
CMD ->> CMD: Print "No users configured."
CMD ->> CMD: Set ExitWithError = true
CMD ->> CMD: Exit function early
else Users exist
CMD ->> CMD: Continue with listing users
end
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (6)`*/**(html|markdown|md)`: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure t...
`*/**(html|markdown|md)`: - Use bold to mark UI strings. - If "" are used to mark UI strings, replace them by bold.
`*/**(html|markdown|md)`: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
`*/**(html|markdown|md)`: - Use sentence-style capitalization also in headings.
`*/**(html|markdown|md)`: do not comment on HTML used for icons
`*/**(html|markdown|md)`: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
🧬 Code Graph Analysis (1)cmd/auth_reset.go (1)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Reset on a fresh install shows a rather confusing message:
List of users:
Select a user to reset the password for [1-0]:
When the list is empty, just print an error and quit.
Summary by CodeRabbit