Bug in `authorization_url` `include_granted_scopes` parameter
Closed this issue · 4 comments
Ahsoka commented
When include_granted_scopes
is not passed in as a parameter, the following error occurs:
This is because when you do json.dumps(include_granted_scopes)
it bypasses the if statement.
aiogoogle/aiogoogle/auth/managers.py
Lines 412 to 423 in 8fd6b73
Maybe something like this instead:
for param_name, param in {
"client_id": client_creds["client_id"],
"response_type": response_type,
"state": state,
"access_type": access_type,
"include_granted_scopes": include_granted_scopes,
"login_hint": login_hint,
"prompt": prompt,
}.items():
if param is not None:
uri += f"&{parse.urlencode({param_name: json.dumps(param) if isinstance(param, bool) else param})}"
omarryhan commented
Agreed 👍
Ahsoka commented
Also I just noticed that here I used an f-string
, not sure if this library is meant to be compatible pre Python 3.6. If so, then you will have to remove it.
omarryhan commented
Yeah, 3.6 is the oldest version we support. So we should be all good. Thanks for the heads up.
omarryhan commented
Thanks! will release a new version once CI is done