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 2020/09/08 07:20:33 UTC
[incubator-ponymail-foal] 02/02: clean up module syntax
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
commit 5b5ee7c2ff58993987372cbe34ee7917ab6be327
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Sep 8 09:19:27 2020 +0200
clean up module syntax
---
server/plugins/oauthGoogle.py | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/server/plugins/oauthGoogle.py b/server/plugins/oauthGoogle.py
index 4f94843..153937d 100644
--- a/server/plugins/oauthGoogle.py
+++ b/server/plugins/oauthGoogle.py
@@ -6,23 +6,21 @@ oauth:
google_client_id: your-client-id-here
"""
+import google.auth.transport.requests
+import google.oauth2.id_token
import plugins.server
import plugins.session
-import requests
-from google.oauth2 import id_token
-from google.auth.transport import requests
-
async def process(formdata, session, server: plugins.server.BaseServer):
js = None
- request = requests.Request()
-
- id_info = await server.runners.run(id_token.verify_oauth2_token,
- formdata.get("id_token"),
- request,
- server.config.oauth.google_client_id
- )
+ request = google.auth.transport.requests.Request()
+ id_info = await server.runners.run(
+ google.oauth2.id_token.verify_oauth2_token,
+ formdata.get("id_token"),
+ request,
+ server.config.oauth.google_client_id,
+ )
if id_info and "email" in id_info:
js = {