feat: Add password confirmation (#4072)

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
Casper 2024-06-19 08:10:00 +02:00 committed by GitHub
parent 98cbcfc171
commit d7dab2d20d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 15 additions and 10 deletions

View file

@ -98,9 +98,14 @@ function __account_already_exists() {
# Also used by addsaslpassword
function _password_request_if_missing() {
local PASSWD_CONFIRM
if [[ -z ${PASSWD} ]]; then
read -r -s -p 'Enter Password: ' PASSWD
echo
[[ -z ${PASSWD} ]] && _exit_with_error 'Password must not be empty'
read -r -s -p 'Confirm Password: ' PASSWD_CONFIRM
echo
[[ ${PASSWD} != "${PASSWD_CONFIRM}" ]] && _exit_with_error 'Passwords do not match!'
fi
}