Skip to content

Commit

Permalink
Fix auth
Browse files Browse the repository at this point in the history
  • Loading branch information
python273 committed Apr 29, 2021
1 parent 72cddb0 commit 307aa55
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vk_api/vk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,9 @@ def _api_login(self):
parsed_url = urlparse(response.url)
parsed_query = parse_qs(parsed_url.query)

if 'authorize_url' not in parsed_query:
raise AuthError(get_unknown_exc_str('API AUTH; no authorize_url'))
if 'authorize_url' in parsed_query:
parsed_url = urlparse(parsed_query['authorize_url'][0])

parsed_url = urlparse(parsed_query['authorize_url'][0])
parsed_query = parse_qs(parsed_url.fragment)

token = {k: v[0] for k, v in parsed_query.items()}
Expand Down

0 comments on commit 307aa55

Please sign in to comment.