Fix missed auth failure due to jq 'null' string

This commit is contained in:
2026-04-02 19:36:48 -04:00
parent ff24a10667
commit f063e6da8c

View File

@@ -405,9 +405,9 @@ if ! bao_token_reply=$(_curl -H 'Content-Type: application/json' \
"$BAO_ADDR/v1/auth/$BAO_AUTH_PATH/login"); then "$BAO_ADDR/v1/auth/$BAO_AUTH_PATH/login"); then
err "Failed to login to '$BAO_ADDR'" err "Failed to login to '$BAO_ADDR'"
fi fi
bao_token=$(printf '%s' "$bao_token_reply" | jq -er '.auth.client_token') bao_token=$(printf '%s' "$bao_token_reply" | jq -er '.auth.client_token') ||
err "Failed to get AppRole login token from '$BAO_ADDR'"
unset bao_token_reply unset bao_token_reply
[ -n "$bao_token" ] || err "Failed to get token from '$BAO_ADDR'"
# Get latest PIA token # Get latest PIA token
get_token_reply="$( get_token_reply="$(