Skip to content

Commit

Permalink
Fix 2FA
Browse files Browse the repository at this point in the history
  • Loading branch information
ray1025 authored May 17, 2024
1 parent 1a4d23d commit 897fff3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions noip-renew.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
Expand Down Expand Up @@ -111,9 +112,9 @@ def login(self):
self.logger.log("Sending OTP...")

ele_challenge = elem.find_element(By.NAME, "challenge_code")

ele_challenge.send_keys(TOTP(self.totp_secret).now())
ele_challenge.send_keys(Keys.ENTER)
self.browser.execute_script("arguments[0].focus();", ele_challenge)
ActionChains(self.browser).send_keys(TOTP(self.totp_secret).now()).perform()
ActionChains(self.browser).send_keys(Keys.ENTER).perform()

# After Loggin browser loads my.noip.com page - give him some time to load
# 'noip-cart' element is near the end of html, so html have been loaded
Expand Down

0 comments on commit 897fff3

Please sign in to comment.