From 4b0ccd862f797f64f0a17013691476a4df7455a7 Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Tue, 5 Nov 2024 15:39:58 +0100 Subject: [PATCH] Fix Token expires --- nginx_proxy_manager_cli.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nginx_proxy_manager_cli.sh b/nginx_proxy_manager_cli.sh index 292593f..e079a72 100755 --- a/nginx_proxy_manager_cli.sh +++ b/nginx_proxy_manager_cli.sh @@ -325,8 +325,8 @@ display_info() { if [ -f "$TOKEN_FILE" ]; then echo -e " ${COLOR_GREEN}Token NPM ${COLOR_YELLOW} $TOKEN_FILE ${COLOR_RESET}" else - echo -e " ${COLOR_RED}Token file does not exist! ${COLOR_RESET} \n 🔖 Check ./nginx_proxy_manager_cli.sh --check-token " - echo -e " Generating new token..." + #echo -e " ${COLOR_RED}Token file does not exist! ${COLOR_RESET}" + echo -e " ${COLOR_GREEN} Generating new token... ${COLOR_RESET} \n 🔖 Check ./nginx_proxy_manager_cli.sh --check-token " generate_token fi @@ -394,7 +394,8 @@ colorize_booleanh() { generate_token() { response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT" \ -H "Content-Type: application/json; charset=UTF-8" \ - --data-raw "{\"identity\":\"$API_USER\",\"secret\":\"$API_PASS\",\"expiry\":\"$TOKEN_EXPIRY\"}") + --data-raw "{\"identity\":\"$API_USER\",\"secret\":\"$API_PASS\"}") + #--data-raw "{\"identity\":\"$API_USER\",\"secret\":\"$API_PASS\",\"expiry\":\"$TOKEN_EXPIRY\"}") token=$(echo "$response" | jq -r '.token') expires=$(echo "$response" | jq -r '.expires')