diff --git a/release/bash/gupload b/release/bash/gupload index c17b553..0969f33 100755 --- a/release/bash/gupload +++ b/release/bash/gupload @@ -1022,7 +1022,7 @@ cat "$TMPFILE.code" return 1 fi (rm -f "$TMPFILE.code"&) -response_check_refresh_token="$(_curl --compressed "$CURL_PROGRESS" -X POST \ +response_check_refresh_token="$(curl --compressed "$CURL_PROGRESS" -X POST \ --data "code=$authorization_code&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&redirect_uri=$REDIRECT_URI%3A$server_port_check_refresh_token&grant_type=authorization_code&code_verifier=$code_challenge_check_refresh_token" "$TOKEN_URL")"||: _clear_line 1 1>&2 refresh_token_value_check_refresh_token="$(printf "%s\n" "$response_check_refresh_token"|_json_value refresh_token 1 1)"||{ printf "%s\n" "Error: Cannot fetch refresh token, make sure the authorization code was correct."&&printf "%s\n" "$response_check_refresh_token"&&return 1;} diff --git a/release/sh/gupload b/release/sh/gupload index 983ebc1..aefe030 100755 --- a/release/sh/gupload +++ b/release/sh/gupload @@ -995,7 +995,7 @@ cat "$TMPFILE.code" return 1 fi (rm -f "$TMPFILE.code"&) -response_check_refresh_token="$(_curl --compressed "$CURL_PROGRESS" -X POST \ +response_check_refresh_token="$(curl --compressed "$CURL_PROGRESS" -X POST \ --data "code=$authorization_code&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&redirect_uri=$REDIRECT_URI%3A$server_port_check_refresh_token&grant_type=authorization_code&code_verifier=$code_challenge_check_refresh_token" "$TOKEN_URL")"||: _clear_line 1 1>&2 refresh_token_value_check_refresh_token="$(printf "%s\n" "$response_check_refresh_token"|_json_value refresh_token 1 1)"||{ printf "%s\n" "Error: Cannot fetch refresh token, make sure the authorization code was correct."&&printf "%s\n" "$response_check_refresh_token"&&return 1;} diff --git a/src/common/auth-utils.sh b/src/common/auth-utils.sh index 23222ee..dc596dd 100644 --- a/src/common/auth-utils.sh +++ b/src/common/auth-utils.sh @@ -398,12 +398,12 @@ EOF (rm -f "${TMPFILE}.code" &) # https://developers.google.com/identity/protocols/oauth2/native-app#handlingresponse - response_check_refresh_token="$(_curl --compressed "${CURL_PROGRESS}" -X POST \ + response_check_refresh_token="$(curl --compressed "${CURL_PROGRESS}" -X POST \ --data "code=${authorization_code}&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&redirect_uri=${REDIRECT_URI}%3A${server_port_check_refresh_token}&grant_type=authorization_code&code_verifier=${code_challenge_check_refresh_token}" "${TOKEN_URL}")" || : _clear_line 1 1>&2 refresh_token_value_check_refresh_token="$(printf "%s\n" "${response_check_refresh_token}" | _json_value refresh_token 1 1)" || - { printf "%s\n" "Error: Cannot fetch refresh token, make sure the authorization code was correct." && printf "%s\n" "${response_check_refresh_token}" && return 1; } + { printf "%s\n" "Error: Code was not fetched properly , here is some info that maybe helpful.." && printf "%s\n" "${response_check_refresh_token}" && return 1; } _set_value direct REFRESH_TOKEN "${refresh_token_value_check_refresh_token}" { _check_access_token "${account_name_check_refresh_token}" skip_check "${response_check_refresh_token}" &&