Skip to content

Commit

Permalink
Update 2FA exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
python273 committed Nov 17, 2020
1 parent e014b1f commit 04f5fc0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions vk_api/vk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _vk_login(self, captcha_sid=None, captcha_key=None):
raise BadPassword('Bad password')

if 'act=authcheck' in response.text:
self.logger.info('Two factor is required')
self.logger.info('2FA is required')

response = self.http.get('https://vk.com/login?act=authcheck')

Expand Down Expand Up @@ -320,8 +320,8 @@ def _pass_twofactor(self, auth_response):

if not auth_hash:
raise TwoFactorError(
'Two factor authentication can not be passed:'
' could not find "hash" value. Please create a bugreport'
'Two-factor authentication can not be passed:'
' could not find "hash" value. Please send a bugreport'
)

code, remember_device = self.error_handlers[TWOFACTOR_CODE]()
Expand Down Expand Up @@ -350,7 +350,10 @@ def _pass_twofactor(self, auth_response):
elif status == '2':
raise TwoFactorError('Recaptcha required')

raise TwoFactorError('Two factor authentication failed')
raise TwoFactorError(
'Two-factor authentication can not be passed.'
' Please send a bugreport'
)

def _pass_security_check(self, response=None):
""" Функция для обхода проверки безопасности (запрос номера телефона)
Expand Down

0 comments on commit 04f5fc0

Please sign in to comment.