From f579aba650edb6f5d8865a6435ada31be8c604bb Mon Sep 17 00:00:00 2001 From: andre <1+andre@noreply.192.168.100.5> Date: Sat, 23 May 2026 11:27:32 +0200 Subject: [PATCH] =?UTF-8?q?Endurain/auto-upload/login.sh=20hinzugef=C3=BCg?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Endurain/auto-upload/login.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Endurain/auto-upload/login.sh 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