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 4f86e38 Simplify
4f86e38 is described below
commit 4f86e38cab3c591479067c9e7828b5696e0c0a96
Author: Daniel Gruno <[email protected]>
AuthorDate: Tue Jun 8 13:16:00 2021 +0200
Simplify
---
server/endpoints/oauth.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/server/endpoints/oauth.py b/server/endpoints/oauth.py
index c824b28..49eb5f2 100644
--- a/server/endpoints/oauth.py
+++ b/server/endpoints/oauth.py
@@ -37,13 +37,14 @@ async def process(
oauth_token = indata.get("oauth_token")
rv: typing.Optional[dict] = None
+ key: str = indata.get("key", "")
# Google OAuth - currently fetches email address only
- if indata.get("key", "") == "google" and id_token and
server.config.oauth.google_client_id:
+ if key == "google" and id_token and server.config.oauth.google_client_id:
rv = await plugins.oauthGoogle.process(indata, session, server)
# GitHub OAuth - Fetches name and email
- elif indata.get("key", "") == "github" and code and
server.config.oauth.github_client_id:
+ elif key == "github" and code and server.config.oauth.github_client_id:
rv = await plugins.oauthGithub.process(indata, session, server)
# Generic OAuth handler, only one we support for now. Works with ASF OAuth.