summaryrefslogtreecommitdiffstats
path: root/server/hack/rwgps-get-auth-token.sh
diff options
context:
space:
mode:
Diffstat (limited to 'server/hack/rwgps-get-auth-token.sh')
-rwxr-xr-xserver/hack/rwgps-get-auth-token.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/hack/rwgps-get-auth-token.sh b/server/hack/rwgps-get-auth-token.sh
new file mode 100755
index 0000000..d7a14a5
--- /dev/null
+++ b/server/hack/rwgps-get-auth-token.sh
@@ -0,0 +1,14 @@
1#!/bin/bash
2
3rwgps_api_key="$(jq <config.json '.rwgps.api_key' -r)"
4
5echo -n "RWGPS account email: "
6read rwgps_email
7echo -n "RWGPS account password: "
8read rwgps_password
9
10jq -nc --arg email "$rwgps_email" --arg password "$rwgps_password" \
11 '{"user": {"email": $email, "password": $password}}' \
12 | curl --json @- -H "x-rwgps-api-key: $rwgps_api_key" \
13 https://ridewithgps.com/api/v1/auth_tokens.json
14echo