mirror of
https://github.com/Erreur32/nginx-proxy-manager-Bash-API.git
synced 2024-12-22 05:22:11 +01:00
Fix Token expires
This commit is contained in:
parent
3d98c7f775
commit
4b0ccd862f
1 changed files with 4 additions and 3 deletions
|
@ -325,8 +325,8 @@ display_info() {
|
||||||
if [ -f "$TOKEN_FILE" ]; then
|
if [ -f "$TOKEN_FILE" ]; then
|
||||||
echo -e " ${COLOR_GREEN}Token NPM ${COLOR_YELLOW} $TOKEN_FILE ${COLOR_RESET}"
|
echo -e " ${COLOR_GREEN}Token NPM ${COLOR_YELLOW} $TOKEN_FILE ${COLOR_RESET}"
|
||||||
else
|
else
|
||||||
echo -e " ${COLOR_RED}Token file does not exist! ${COLOR_RESET} \n 🔖 Check ./nginx_proxy_manager_cli.sh --check-token "
|
#echo -e " ${COLOR_RED}Token file does not exist! ${COLOR_RESET}"
|
||||||
echo -e " Generating new token..."
|
echo -e " ${COLOR_GREEN} Generating new token... ${COLOR_RESET} \n 🔖 Check ./nginx_proxy_manager_cli.sh --check-token "
|
||||||
generate_token
|
generate_token
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -394,7 +394,8 @@ colorize_booleanh() {
|
||||||
generate_token() {
|
generate_token() {
|
||||||
response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT" \
|
response=$(curl -s -X POST "$BASE_URL$API_ENDPOINT" \
|
||||||
-H "Content-Type: application/json; charset=UTF-8" \
|
-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')
|
token=$(echo "$response" | jq -r '.token')
|
||||||
expires=$(echo "$response" | jq -r '.expires')
|
expires=$(echo "$response" | jq -r '.expires')
|
||||||
|
|
Loading…
Reference in a new issue