change the access token to be cached
This commit is contained in:
@@ -4,8 +4,6 @@ set -e
|
||||
IFS=$'\0'
|
||||
myPID=$$
|
||||
. helpers.sh
|
||||
./getNewAccessToken.sh
|
||||
|
||||
|
||||
marketOpen=$([[ $(./getMarketHours.sh | jq '.option[].isOpen' | grep true | wc -l) -ne 0 ]] && echo true || echo false)
|
||||
if [[ ${marketOpen} == false ]]; then
|
||||
@@ -178,7 +176,7 @@ fi
|
||||
|
||||
curl -s -X POST \
|
||||
"https://api.schwabapi.com/trader/v1/accounts/$(./getAccountNumbers.sh Regular)/orders" \
|
||||
-H "Authorization: Bearer $(<access_token.dat)" \
|
||||
-H "Authorization: Bearer $(./getNewAccessToken.sh)" \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "${orderJson}"
|
||||
|
||||
Reference in New Issue
Block a user