From 12252214628a6c24c805c6c978970df61104865e Mon Sep 17 00:00:00 2001 From: saranyaloganathan23 Date: Fri, 2 Aug 2024 10:54:46 +0530 Subject: [PATCH] changing login get request to post --- dataproc_jupyter_plugin/handlers.py | 2 +- src/login/authLogin.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dataproc_jupyter_plugin/handlers.py b/dataproc_jupyter_plugin/handlers.py index 459379d1..a5822c3a 100644 --- a/dataproc_jupyter_plugin/handlers.py +++ b/dataproc_jupyter_plugin/handlers.py @@ -122,7 +122,7 @@ async def get(self): class LoginHandler(APIHandler): @tornado.web.authenticated - async def get(self): + async def post(self): cmd = "gcloud auth login" process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True diff --git a/src/login/authLogin.tsx b/src/login/authLogin.tsx index 3fecc37c..33f3a34f 100644 --- a/src/login/authLogin.tsx +++ b/src/login/authLogin.tsx @@ -54,7 +54,9 @@ const AuthLoginComponent = ({ const login = async () => { setIsloginDisabled(true); - const data = await requestAPI('login'); + const data = await requestAPI('login', { + method: 'POST' + });; if (typeof data === 'object' && data !== null) { const loginStatus = (data as { login: string }).login; if (loginStatus === STATUS_SUCCESS) {