Merge branch 'main' into frontend/fix-paste-errormessage
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
cami 2021-07-23 01:05:32 +02:00
commit 9f4e097e27
2 changed files with 13 additions and 5 deletions

View file

@ -113,7 +113,7 @@ def refresh():
$ curl http://localhost:5000/api/refresh -X GET \
-H "Authorization: Bearer <your_token>"
"""
old_token = request.get_data()
old_token = flask.request.get_data()
new_token = guard.refresh_jwt_token(old_token)
ret = {'access_token': new_token}
return ret, 200

View file

@ -1,11 +1,11 @@
#!/bin/bash
ACTION=$1
TOKEN=$2
ACTIONS=(login register rcvpw username)
VALUE=$2
ACTIONS=(login register rcvpw username data csv)
print_help(){
echo "Usage: $0 ACTION [TOKEN]"
echo "Usage: $0 ACTION [TOKEN|INPUT_TYPE]"
echo
echo "available actions:"
for el in "${ACTIONS[@]}"; do
@ -34,7 +34,15 @@ case $ACTION in
;;
"${ACTIONS[3]}") # get current username
echo "get username action"
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $TOKEN"
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $VALUE"
;;
"${ACTIONS[4]}") # get all data from behametricsserver
echo "get data action"
curl localhost:5000/data
;;
"${ACTIONS[5]}") # get all data from behametricsserver
echo "get data action"
curl localhost:5000/data/csv/"${VALUE}"
;;
*)
echo "Error: Action not available"