From 15cef3ab1d2a3a06cbf8a929c9fe156f9870f61f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 18:43:13 +0000 Subject: [PATCH] authelia: show existing users before asking who to scope access to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _authelia_scope_access asked for usernames to grant access to a service without ever showing who already exists — confirmed live, the prompt just showed a blank "Usernames:" line with nothing to reference. A typo against an existing name doesn't fail or warn, it silently creates a new, separate account instead of matching the intended one. Now lists existing Authelia users (reusing _authelia_list_usernames, already used elsewhere in this file) right before the prompt, and warns about the typo/duplicate-account risk explicitly. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01YEQNc4NfBST1m9NtCZVYa8 --- services/authelia.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/authelia.sh b/services/authelia.sh index 007ca2f..37e929a 100644 --- a/services/authelia.sh +++ b/services/authelia.sh @@ -1036,9 +1036,18 @@ _authelia_scope_access() { prompt_text " Choice [1/2]:" "1" scope_choice [ "$scope_choice" = "2" ] || return 0 + local -a existing_users + mapfile -t existing_users < <(_authelia_list_usernames "$users_file") + if [ "${#existing_users[@]}" -gt 0 ]; then + echo " Existing Authelia users: ${existing_users[*]}" + else + echo " No existing Authelia users yet — anyone you list below gets created fresh." + fi echo " Usernames who should have access (space-separated). Anyone listed" echo " who doesn't already have an Authelia account gets one created —" - echo " you'll get their temporary password to hand over." + echo " you'll get their temporary password to hand over. Typos against an" + echo " existing name above create a new, separate account instead of" + echo " matching it, so copy from that list rather than retyping from memory." local raw_users="" prompt_text " Usernames:" "" raw_users local -a usernames