You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/05/09 17:49:49 UTC
[incubator-ponymail-foal] branch master updated: async with!
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 429f50a async with!
429f50a is described below
commit 429f50a84827e6e9e7a196d0d17991761cc8485b
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun May 9 19:49:41 2021 +0200
async with!
---
server/plugins/oauthGithub.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/plugins/oauthGithub.py b/server/plugins/oauthGithub.py
index 47ede9b..e724d89 100644
--- a/server/plugins/oauthGithub.py
+++ b/server/plugins/oauthGithub.py
@@ -18,12 +18,12 @@ async def process(formdata, session, server: plugins.server.BaseServer) -> typin
formdata["client_id"] = server.config.oauth.github_client_id
formdata["client_secret"] = server.config.oauth.github_client_secret
headers = {"Accept": "application/json"}
- with aiohttp.client.request(
+ async with aiohttp.client.request(
"POST", "https://github.com/login/oauth/access_token", headers=headers, data=formdata
) as rv:
resp = await rv.json()
if "access_token" in resp:
- with aiohttp.client.request(
+ async with aiohttp.client.request(
"GET", "https://api.github.com/user", headers={"authorization": "token %s" % resp["access_token"]}
) as orv:
js = await orv.json()