File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,8 @@ TOKEN_FILE="$TOKEN_DIR/token_${NGINX_IP}.txt"
139139
140140# Set Token duration validity.
141141TOKEN_EXPIRY=" 365d"
142+ # TOKEN_EXPIRY="31536000s"
143+ # TOKEN_EXPIRY="1y"
142144
143145# Default variables (you can adapt)
144146CACHING_ENABLED=false
@@ -423,9 +425,8 @@ colorize_booleanh() {
423425# Generate a new API token
424426generate_token () {
425427
426- # response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT?expiry=$TOKEN_EXPIRY" \
427-
428- response=$( curl -s -X POST " $BASE_URL$API_ENDPOINT ?expiresIn=$TOKEN_EXPIRY " \
428+ # response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT?expiresIn=$TOKEN_EXPIRY" \
429+ response=$( curl -s -X POST " $BASE_URL$API_ENDPOINT ?expiry=$TOKEN_EXPIRY " \
429430 -H " Content-Type: application/json; charset=UTF-8" \
430431 --data-raw " {\" identity\" :\" $API_USER \" ,\" secret\" :\" $API_PASS \" }" )
431432
@@ -437,8 +438,11 @@ generate_token() {
437438 token=$( echo " $response " | jq -r ' .token' )
438439 expires=$( echo " $response " | jq -r ' .expires' )
439440
440- # Debug
441- # echo -e "\n $BASE_URL$API_ENDPOINT?expiry=$TOKEN_EXPIRY \n"
441+ # # Debug
442+ echo " Request URL: $BASE_URL$API_ENDPOINT ?expiry=$TOKEN_EXPIRY "
443+ echo " Request Body: {\" identity\" :\" $API_USER \" ,\" secret\" :\" $API_PASS \" }"
444+ echo " Response: $response "
445+ # #
442446
443447 if [ " $token " != " null" ]; then
444448 echo " $token " > $TOKEN_FILE
You can’t perform that action at this time.
0 commit comments