Commit 10ab59a6518c
Changed files (1)
pkgs
my
scripts
bin
pkgs/my/scripts/bin/yubikey-oath
@@ -26,8 +26,8 @@ if [ -z "$selected" ]; then
exit 0
fi
-# Get the code for the selected account
-code=$(ykman oath accounts code --single "$selected" 2>&1 | awk '{print $NF}')
+# Get the code for the selected account (extract just the digits)
+code=$(ykman oath accounts code --single "$selected" 2>&1 | grep -oE '[0-9]{6,8}')
if [ -z "$code" ]; then
notify-send "YubiKey OATH" "Failed to get code for $selected" --urgency=critical