Files
scripts/Endurain/auto-upload/login.sh
T
2026-05-23 11:43:12 +02:00

16 lines
347 B
Bash

#!/usr/bin/env bash
source ~/cycling/app/.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'