From dd9056c1654d7a7906e9b8d8045183a8e70f270d Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Fri, 8 Dec 2023 10:16:56 +0000 Subject: [PATCH] dev: take configuration value for Github client secret from get_configuration --- apiserver/plane/app/views/oauth.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/app/views/oauth.py b/apiserver/plane/app/views/oauth.py index e12cba2ae..8a0396137 100644 --- a/apiserver/plane/app/views/oauth.py +++ b/apiserver/plane/app/views/oauth.py @@ -86,7 +86,14 @@ def get_access_token(request_token: str, client_id: str) -> str: if not request_token: raise ValueError("The request token has to be supplied!") - CLIENT_SECRET = os.environ.get("GITHUB_CLIENT_SECRET") + (CLIENT_SECRET,) = get_configuration_value( + [ + { + "key": "GITHUB_CLIENT_SECRET", + "default": os.environ.get("GITHUB_CLIENT_SECRET", None), + }, + ] + ) url = f"https://github.com/login/oauth/access_token?client_id={client_id}&client_secret={CLIENT_SECRET}&code={request_token}" headers = {"accept": "application/json"} @@ -299,7 +306,7 @@ class OauthEndpoint(BaseAPIView): return Response(data, status=status.HTTP_200_OK) except User.DoesNotExist: - ENABLE_SIGNUP, = get_configuration_value( + (ENABLE_SIGNUP,) = get_configuration_value( [ { "key": "ENABLE_SIGNUP",