Fixed id selection for 2fa rofi

This commit is contained in:
Michel Fedde 2025-10-17 16:40:31 +02:00
parent ab7d9f188e
commit 032cab6ba8

View file

@ -27,10 +27,10 @@ getApiToken
setOption no-custom true setOption no-custom true
case $ROFI_RETV in case $ROFI_RETV in
0) 0)
echo -en $(curl --oauth2-bearer "$token" "$DOMAIN/api/v1/twofaccounts" | jq -r '.[] | "\(.id)\\0display\\x1f\(.service) - \(.account)\\x1finfo\\x1f\(.)\\n"') echo -en $(curl --oauth2-bearer "$token" "$DOMAIN/api/v1/twofaccounts" | jq -r 'map("\(.id)\\0display\\x1f\(.service) - \(.account)\\x1finfo\\x1f\(.)\\n") | add')
;; ;;
1) 1)
id=$@ id=$(echo $ROFI_INFO | jq -r '.id')
curl --oauth2-bearer "$token" "$DOMAIN/api/v1/twofaccounts/$id/otp" | curl --oauth2-bearer "$token" "$DOMAIN/api/v1/twofaccounts/$id/otp" |
jq ".password" -r | jq ".password" -r |