From 0c330683981a4e22f342c395607c61413a8feed3 Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Wed, 31 Dec 2025 01:28:25 +0200 Subject: [PATCH] Fix google auth url --- frontend/src/api/api.js | 2 +- frontend/src/components/GoogleImport.jsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/api.js b/frontend/src/api/api.js index 9e7100a..2e15d4e 100644 --- a/frontend/src/api/api.js +++ b/frontend/src/api/api.js @@ -1,6 +1,6 @@ import axios from 'axios' -const API_BASE_URL = 'http://localhost:8000' +const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000' const api = axios.create({ baseURL: API_BASE_URL, diff --git a/frontend/src/components/GoogleImport.jsx b/frontend/src/components/GoogleImport.jsx index 3a1e37b..c362f10 100644 --- a/frontend/src/components/GoogleImport.jsx +++ b/frontend/src/components/GoogleImport.jsx @@ -28,7 +28,8 @@ function GoogleImport({ onImportComplete }) { const handleGoogleImport = () => { setImporting(true) // Redirect to backend OAuth endpoint (owner will be extracted from email) - window.location.href = 'http://localhost:8000/auth/google' + const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000' + window.location.href = `${apiUrl}/auth/google` } return (