File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
151148echo " ==> Searching for login window..."
152149# Use --sync to wait for the window to appear (up to 30s)
153150WINDOW_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
176173sleep 1
177174take_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+
179180echo " ==> Entering credentials..."
180181# Click on the email field area (center of the window, upper portion)
181182WX=$( xdotool getwindowgeometry --shell " $WINDOW_ID " 2> /dev/null | grep X= | cut -d= -f2 || echo 0)
You can’t perform that action at this time.
0 commit comments