changed a bunch of stuff to async

This commit is contained in:
Philip Dowie
2020-08-16 10:19:14 +12:00
parent 2076f1c1df
commit 511ecc0ce0
3 changed files with 20 additions and 20 deletions

View File

@@ -137,14 +137,14 @@ class DiscordOAuth2Session(_http.DiscordOAuth2HttpClient):
"""
return session.get("DISCORD_OAUTH2_TOKEN")
def callback(self):
async def callback(self):
"""A method which should be always called after completing authorization code grant process
usually in callback view.
It fetches the authorization token and saves it quart
`session <https://pgjones.gitlab.io/quart/reference/source/quart.sessions.html#quart.sessions.Session>`_ object.
"""
error = request.values.get("error")
error = await request.values.get("error")
if error:
if error == "access_denied":
raise exceptions.AccessDenied()