change the access token to be cached

This commit is contained in:
2024-09-03 10:32:56 -05:00
parent 1b94d1d8dc
commit bd682f670f
15 changed files with 29 additions and 40 deletions

View File

@@ -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
@@ -90,7 +88,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}"