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
|
// Function to handle Google OAuth callback and fetch spreadsheets
|
||||||
const handleOAuthCallback = async () => {
|
const handleOAuthCallback = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get('http://localhost:8080/auth/google/callback');
|
const response = await axios.post('http://localhost:8080/auth/google/callback', {
|
||||||
const { email, files } = response.data;
|
// code: new URLSearchParams(window.location.search).get('code'),
|
||||||
setUserInfo({ email });
|
robotId: ''
|
||||||
|
});
|
||||||
|
const { google_sheet_email, files } = response.data;
|
||||||
|
setUserInfo({ email:google_sheet_email });
|
||||||
setSpreadsheets(files);
|
setSpreadsheets(files);
|
||||||
setIsAuthenticated(true);
|
setIsAuthenticated(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user