From 7c352d9e82535ffd1c31e16a58ab74bda99e0c2b Mon Sep 17 00:00:00 2001 From: arrelin Date: Tue, 10 Mar 2026 14:59:04 +0300 Subject: [PATCH] mobile update --- backend/src/lib.rs | 2 +- frontend/vite.config.ts | 14 ++++++++++++++ mobile/src-tauri/tauri.conf.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/backend/src/lib.rs b/backend/src/lib.rs index 265f36c..f2bcc14 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -231,7 +231,7 @@ pub async fn create_app(db: DatabaseConnection) -> Result { .url("/api-docs/openapi.json", ApiDoc::openapi()); let allowed_origins = std::env::var("ALLOWED_ORIGINS") - .unwrap_or_else(|_| "http://localhost:3000,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:8080".to_string()); + .unwrap_or_else(|_| "http://localhost:3000,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:8080,http://localhost:1420,http://tauri.localhost,https://tauri.localhost".to_string()); let origins: Vec = allowed_origins .split(',') diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index d02704b..570f7a9 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -12,6 +12,20 @@ export default defineConfig({ ? 'https://family-budget.duckdns.org' : 'http://localhost:8080', changeOrigin: true, + configure: (proxy) => { + if (process.env.TAURI_DEV_HOST) { + proxy.on('proxyRes', (proxyRes) => { + const cookies = proxyRes.headers['set-cookie']; + if (cookies) { + proxyRes.headers['set-cookie'] = cookies.map(cookie => + cookie + .replace(/;\s*Secure/gi, '') + .replace(/;\s*Domain=[^;]*/gi, '') + ); + } + }); + } + }, } } } diff --git a/mobile/src-tauri/tauri.conf.json b/mobile/src-tauri/tauri.conf.json index 5a8138d..aea257f 100644 --- a/mobile/src-tauri/tauri.conf.json +++ b/mobile/src-tauri/tauri.conf.json @@ -6,7 +6,7 @@ "build": { "beforeDevCommand": "npm run dev --prefix ../frontend", "devUrl": "http://localhost:5173", - "beforeBuildCommand": "npm run build --prefix ../frontend", + "beforeBuildCommand": "VITE_API_BASE_URL=https://family-budget.duckdns.org/api npm run build --prefix ../frontend", "frontendDist": "../frontend/dist" }, "app": { -- 2.49.1