Skip to content
Merged

fix #426

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dev/troubleshooting/login_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,25 @@ if [[ -z "$url" || -z "$user" ]]; then
usage
fi

if [[ -n "$DIGMA_PASSWORD" ]]; then
echo "Using password from DIGMA_PASSWORD environment variable"
pwd="$DIGMA_PASSWORD"
fi

# Prompt for password if not provided
if [[ -z "$pwd" ]]; then
echo -n "Enter password for user '$user': "
read -s pwd
echo ""
fi

if [[ -z "$pwd" ]]; then
echo "Password is required but not provided. Please run the script with --pwd option or set DIGMA_PASSWORD environment variable." >&2
echo "Example: DIGMA_PASSWORD=mypassword curl -s https://raw.githubusercontent.com/digma-ai/digma/main/dev/troubleshooting/login_test.sh | bash -s -- --url <URL> --user <USER> --token <TOKEN>" >&2
exit 1
fi


echo -n "login to $url/Authentication/login"
echo ""
response=$(curl -s -w "HTTPSTATUS:%{http_code}" -X 'POST' \
Expand Down