feat: get google_sheet_mail + post request for google auth callback
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user