From 137bac49a01be0b8c09bf0e8efcd61a1259bdabd Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 17 Oct 2024 00:15:28 +0530 Subject: [PATCH] feat: get google_sheet_mail + post request for google auth callback --- src/components/molecules/IntegrationSettings.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/molecules/IntegrationSettings.tsx b/src/components/molecules/IntegrationSettings.tsx index a7c68c96..3c411045 100644 --- a/src/components/molecules/IntegrationSettings.tsx +++ b/src/components/molecules/IntegrationSettings.tsx @@ -36,9 +36,12 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I // Function to handle Google OAuth callback and fetch spreadsheets const handleOAuthCallback = async () => { try { - const response = await axios.get('http://localhost:8080/auth/google/callback'); - const { email, files } = response.data; - setUserInfo({ email }); + const response = await axios.post('http://localhost:8080/auth/google/callback', { + // code: new URLSearchParams(window.location.search).get('code'), + robotId: '' + }); + const { google_sheet_email, files } = response.data; + setUserInfo({ email:google_sheet_email }); setSpreadsheets(files); setIsAuthenticated(true); } catch (error) {