Skip to content

Commit 07b88d2

Browse files
committed
fix(release): generate TOTP after window search, not before
1 parent 72f1f4c commit 07b88d2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/windows-sign.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ take_screenshot "01-after-launch"
145145

146146
# --- Automate login ---
147147

148-
echo "==> Generating TOTP..."
149-
TOTP=$(oathtool --totp=sha256 -b --digits=6 "$CERTUM_TOTP_SECRET")
150-
151148
echo "==> Searching for login window..."
152149
# Use --sync to wait for the window to appear (up to 30s)
153150
WINDOW_ID=$(timeout 30 xdotool search --sync --onlyvisible --name "SimplySign" 2>/dev/null | head -1 || true)
@@ -176,6 +173,10 @@ xdotool windowactivate --sync "$WINDOW_ID" 2>/dev/null || true
176173
sleep 1
177174
take_screenshot "03-before-login"
178175

176+
# Generate TOTP as late as possible (right before typing, not before window search)
177+
echo "==> Generating TOTP..."
178+
TOTP=$(oathtool --totp=sha256 -b --digits=6 "$CERTUM_TOTP_SECRET")
179+
179180
echo "==> Entering credentials..."
180181
# Click on the email field area (center of the window, upper portion)
181182
WX=$(xdotool getwindowgeometry --shell "$WINDOW_ID" 2>/dev/null | grep X= | cut -d= -f2 || echo 0)

0 commit comments

Comments
 (0)