Skip to content

Commit 8e57c4b

Browse files
log: token
1 parent aa44130 commit 8e57c4b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/init.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if ! command -v jq >/dev/null; then
88
fi
99

1010
function get_token {
11-
local token=$(curl --retry 5 -X POST -H "Content-Type: application/json" -d '{"email": "'"$ADMIN_EMAIL"'", "password": "'"$ADMIN_PASSWORD"'"}' $DIRECTUS_URL/auth/login | jq -r '.data.access_token')
11+
local response=$(curl --retry 5 -X POST -H "Content-Type: application/json" -d '{"email": "'"$ADMIN_EMAIL"'", "password": "'"$ADMIN_PASSWORD"'"}' $DIRECTUS_URL/auth/login)
1212
echo "$token"
1313
}
1414

@@ -31,7 +31,11 @@ fi
3131

3232
npx wait-on -t 30s -l "$DIRECTUS_URL/admin/login"
3333

34-
token=$(get_token)
34+
response=$(get_token)
35+
echo "get_token response: $response"
36+
37+
token=$(echo "$response" | jq -r '.data.access_token')
38+
echo "get_token token: $token"
3539

3640
if [ -z "$token" ] || [ "$token" == "null" ]; then
3741
echo "Error: Obtained token is empty: '$token'. Please check ADMIN_EMAIL and ADMIN_PASSWORD values in .env file."

0 commit comments

Comments
 (0)