Skip to content

Commit 998c63b

Browse files
committed
login: put headers in tmpfile
1 parent 0eea696 commit 998c63b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

okapi-hooks.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ login() {
2828
echo "No OKAPI_TOKEN; OKAPI_USER and OKAPI_PASS required"
2929
exit 1
3030
fi
31-
post -f -d"{\"username\":\"${OKAPI_USER}\",\"password\":\"${OKAPI_PASS}\"}" $U/authn/login
32-
OKAPI_TOKEN=`awk '/x-okapi-token/ {print $2}' <headers|tr -d '[:space:]'`
31+
tmp=`mktemp`
32+
post -f -D$tmp -d"{\"username\":\"${OKAPI_USER}\",\"password\":\"${OKAPI_PASS}\"}" $U/authn/login
33+
OKAPI_TOKEN=`awk '/x-okapi-token/ {print $2}' < $tmp|tr -d '[:space:]'`
3334
fi
3435
CURL_TOK="-HX-Okapi-Token:${OKAPI_TOKEN}"
3536
}

0 commit comments

Comments
 (0)