Skip to content

Commit

Permalink
Fixes #71
Browse files Browse the repository at this point in the history
Fixes #72
  • Loading branch information
omarryhan committed Sep 20, 2021
1 parent 8fd6b73 commit 9982f20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aiogoogle/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__about__ = "Async Google API client"
__description__ = __about__
__url__ = "https://github.com/omarryhan/aiogoogle"
__version_info__ = ("2", "1", "0")
__version_info__ = ("2", "1", "1")
__version__ = ".".join(__version_info__)
__author__ = "Omar Ryhan"
__author_email__ = "[email protected]"
Expand Down
13 changes: 5 additions & 8 deletions aiogoogle/auth/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ def authorization_url(
(str): An Authorization URI
"""
client_creds = client_creds or self.client_creds
scopes = scopes or client_creds["scopes"]
scopes = " ".join(client_creds["scopes"])
scopes = " ".join(scopes or client_creds["scopes"])
uri = (
self["authorization_endpoint"]
+ f'?redirect_uri={client_creds["redirect_uri"]}&scope={scopes}&'
Expand All @@ -414,13 +413,12 @@ def authorization_url(
"response_type": response_type,
"state": state,
"access_type": access_type,
"include_granted_scopes": json.dumps(include_granted_scopes),
"include_granted_scopes": include_granted_scopes,
"login_hint": login_hint,
"prompt": prompt,
}.items():
if param is not None:
uri += "&"
uri += parse.urlencode({param_name: param})
uri += f"&{parse.urlencode({param_name: json.dumps(param) if isinstance(param, bool) else param})}"
return uri

async def build_user_creds(
Expand Down Expand Up @@ -980,13 +978,12 @@ def authorization_url(
"response_type": response_type,
"state": state,
"access_type": access_type,
"include_granted_scopes": json.dumps(include_granted_scopes),
"include_granted_scopes": include_granted_scopes,
"login_hint": login_hint,
"prompt": prompt,
}.items():
if param is not None:
uri += "&"
uri += parse.urlencode({param_name: param})
uri += f"&{parse.urlencode({param_name: json.dumps(param) if isinstance(param, bool) else param})}"
return uri

async def build_user_creds(
Expand Down

0 comments on commit 9982f20

Please sign in to comment.