diff --git a/Endurain/auto-upload/login.sh b/Endurain/auto-upload/login.sh new file mode 100644 index 0000000..9cc83c1 --- /dev/null +++ b/Endurain/auto-upload/login.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +source ~/cycling/.config + +MFA_CODE=$(oathtool --totp -b "$TOTP_SECRET") + +TOKENS=$(curl -s -X POST \ + "$SERVER/api/v1/auth/mfa/verify" \ + -H "Content-Type: application/json" \ + -H "X-Client-Type: mobile" \ + -d "{ + \"username\": \"$USER\", + \"mfa_code\": \"$MFA_CODE\" + }") + +echo "$TOKENS" | jq -r '.access_token' \ No newline at end of file