1 Commits

Author SHA1 Message Date
arrelin
7c352d9e82 mobile update 2026-03-10 14:59:04 +03:00
3 changed files with 16 additions and 2 deletions

View File

@@ -231,7 +231,7 @@ pub async fn create_app(db: DatabaseConnection) -> Result<Router, DbErr> {
.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<HeaderValue> = allowed_origins
.split(',')

View File

@@ -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, '')
);
}
});
}
},
}
}
}

View File

@@ -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": {