From 8cd47344eb39d4bbc3a3bcb69e75df393d0cce9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 9 Apr 2025 15:36:10 +0200 Subject: [PATCH] Show error on auth reset with no users configured 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. --- cmd/auth_reset.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/auth_reset.go b/cmd/auth_reset.go index f4f2663..4d786ce 100644 --- a/cmd/auth_reset.go +++ b/cmd/auth_reset.go @@ -109,6 +109,12 @@ only work on some locations. For example, the Operating System CLI. return } + if len(users) == 0 { + cmd.PrintErrln("No users configured.") + ExitWithError = true + return + } + fmt.Println("List of users:") listUsers(users)