Skip to content

Commit

Permalink
fixed deprecated Google Messages handler code
Browse files Browse the repository at this point in the history
  • Loading branch information
Voyz committed Jun 22, 2024
1 parent d297dbb commit e0658c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ibeam/src/two_fa_handlers/google_msg_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def get_two_fa_code(self, _) -> Optional[str]:

WebDriverWait(driver_2fa, 240).until(any_of(sms_auth_present, sms_code_present))

sms_auth_el = driver_2fa.find_elements_by_class_name(_GOOG_QR_CODE_CLASS)
sms_auth_el = driver_2fa.find_elements(By.CLASS_NAME, _GOOG_QR_CODE_CLASS)

if sms_auth_el:
driver_2fa.find_element_by_class_name(_GOOG_AUTH_REMEMBER_CLASS).click()
driver_2fa.find_element(By.CLASS_NAME, _GOOG_AUTH_REMEMBER_CLASS).click()

data = urllib.parse.quote(sms_auth_el[0].get_attribute('data-' + _GOOG_QR_CODE_DATA))

Expand All @@ -73,7 +73,7 @@ def get_two_fa_code(self, _) -> Optional[str]:

WebDriverWait(driver_2fa, 120).until(sms_code_present)

sms_list_el = driver_2fa.find_elements_by_css_selector(_GOOG_MESSAGES_LIST_CLASS)
sms_list_el = driver_2fa.find_elements(By.CSS_SELECTOR, _GOOG_MESSAGES_LIST_CLASS)

if not sms_list_el:
_LOGGER.error('Timeout or authentication error while loading sms messages.')
Expand Down Expand Up @@ -120,4 +120,4 @@ def get_two_fa_code(self, _) -> Optional[str]:
return code_two_fa

def __str__(self):
return f"GoogleMessagesTwoFaHandler(driver_path={self.driver_path})"
return f"GoogleMessagesTwoFaHandler(driver_path={self.driver_factory.driver_path})"

0 comments on commit e0658c8

Please sign in to comment.